Notice: Undefined property: Gather\models\CollectionsList::$mode in /Users/jrobson/git/core/extensions/Gather/includes/models/CollectionsList.php on line 240
|mediawiki/extensions/Gather||master||+1 -0||Make sure mode is always set to avoid php warnings|
tl;dr: The fix is OK.
This could have done with a little more investigation into the underlying problem: it seems like a CollectionsList model is being initialised but never having its mode set and then being rendered.
The /by/<user> route is handled by SpecialGather#renderUserCollectionsList, which calls CollectionsList::newFromApi (with $mode defaulting to null). Regardless of what happens in the body of ::newFromApi, the result never has its mode set, despite an empty string being calculated as its default.
Note the fix is needed as getMode is being called before setMode
Certain collections do not care about mode. This is why the issue was happening. No investigation needed. The line you point to is an API parameter and not the same as the internal protected property.
Certain collections do not care about mode.
This kind of information would have been useful in reproducing the bug/demonstrating that your patch fixed the bug/for posterity. Could you provide more detail next time around?
The line you point to is an API parameter and not the same as the internal protected property.
I missed that the meaning $mode was overloaded there. Mibad. Though, why is $mode reassigned if it's falsy? I guess it doesn't matter.