User "Krinkle" posted a comment on MediaWiki.r18334.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/18334#c22678
Commit summary:

User::getOption now accept a default value to override default user values
this makes it consistent with WebRequest::get* methods. Corrected code in
various places accordingly.

Comment:

Resetting from 'old' to 'fixme' for sanity and tracking. I know it's a 4 year 
old rev, but I don't care right now.

Unless I'm missing some undocumented functionality here, this revision is 
heavily broken and causing bug 30940.

This revision introduces the assumption that a preference is never set to an 
empty string. Although that assumption is not very weird, it's undocumented and 
(moreover) inconsistent because other code doesn't assume this. Albeit that the 
default value of the $default argument is 'false', the equation compares 
against an empty string. Which means if you call the function without providing 
a default you'll get 'false' (instead of of, like previously was the case, an 
empty string).

Aside from that, it's also affecting the user interface. More precisely, in the 
preferences. If a preference (say, a checkbox) sould be set to true by default, 
'''the user will be unable to uncheck the checkbox'''. When the user does so, 
it's instantly reset, because of the weird way it's handled here.

_______________________________________________
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to