Nemanja Karadzic

is there an opposite of Controller::init? Ie action that gets called when every other action is done?

Nemanja Karadzic

anyway, is it possible, via yaml only, to serve output of a method as a field in query?

Nemanja Karadzic

https://github.com/silverstripe/silverstripe-framework/pull/9373

Show 1 attachment(s)
manja

When collecting new texts via i18mTextCollector, get var "merge" was used to skip already collected texts and only append new ones. That's how it worked in CMS3.

Problem is, in CMS4, this was not the case. Even with get var defined, text collector was overwriting translations in yaml files with default values found in classes and templates.

Debugging showed that problem was in single array_merge function:

> Merges the elements of one or more arrays together so that the values of one are appended to the end of the previous one. It returns the resulting array. > > If the input arrays have the same string keys, then the later value for that key will overwrite the previous one. If, however, the arrays contain numeric keys, the later value will not overwrite the original value, but will be appended.

Simply reordering parameters in same call reverted to expected functionality - leave existing translations in place, just add new.

Hide attachment content
Nemanja Karadzic

btw, funny thing about this bug that fix for it doesn't include a single character difference...

(1)
Nemanja Karadzic

if I found small but annoying issue in CMS4, which repo should I fork to make a PR?

Nemanja Karadzic

if I found small but annoying issue in CMS4, which repo should I fork to make a PR?