https://bugzilla.wikimedia.org/show_bug.cgi?id=39773

--- Comment #6 from [email protected] 2012-09-07 13:33:47 UTC ---
The message is shown because when the code from
window.liquidThreads.handleAJAXSave is executed the "text" in the test
> $j.trim( text ).length == 0
is actually undefined. But this was already the case on Gerrit change #17940,
which came before Gerrit change #17683 on
https://gerrit.wikimedia.org/r/#/q/status:merged+project:mediawiki/extensions/LiquidThreads+-owner:L10n-bot,n,z

Indeed, if I do
> cd extensions/LiquidThreads/
> git review -d 17940
and follow the steps from comment 5, I get the error
Uncaught TypeError: Cannot call method 'trim' of undefined

In both cases the fact that the text is undefined do not prevent the code from
another function from saving and reloading the page (even if the
[[translatewiki:MediaWiki:Lqt-empty-text]] is displayed), because none of lines
which contains
> e.preventDefault();
is ever executed.

The reason for "text" being undefined is the line
> text = editform.find('#wpTextbox1').val();
which depends on the existence of some "editform". But it is defined as
> var editform = $j(this).closest('.lqt-edit-form');
and while summarizing a thread there is no element with class "lqt-edit-form".

It seems this specific bug could be fixed by replacing the line which defines
the text by
> text = $j('#wpTextbox1').val();
(because there should be at most one element with this id on the page). But
there will be the problem of "editform" being empty...

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to