Page MenuHomePhabricator

PageForms with 1.34 and editor=wikieditor does not work
Closed, ResolvedPublic

Description

From the support desk:

The editor=wikieditor parameter doesn't work for free text inputs, or any textarea inputs either any more. I've recently upgraded to MW1.34.1 and have Page Forms 4.8 (4d2 68f8). I've checked and the textarea does have class="wikieditor".

[Edited to break up the PF version number so that it didn't automatically link to an unrelated task.]

Event Timeline

I am a little confused. I remembered this problem but back then (in 2018) it seemed to be fixed by adding the following to a form:

input type=textarea

Back then I was happy :-) that the fix was so easy but now this does not work anymore with MW 1.34 and PF 4.9.5 (9e17cd7).
The same thing is happening on the SMW sandbox site, no more wikieditor in a form.
But reading my original comment it worked back then.

It could be that I missed something but it is not clear to me what the problem is, there is a jQuery exception on the Sandbox Site.

image.png (666×723 px, 58 KB)

Thanks.

Best regards,

Felipe.

@Nikerabbit - what does this mean? If you get that change into WikiEditor, can I switch Page Forms to using the simpler code, at least for MW 1.34+?

It is just a quick hack for now, sharing in case someone else finds it useful. It would need more work to get it to WikiEditor proper.

@Nikerabbit, thanks for the fix. This also works in MW-1.35.0

I assume this is not a definitive fix because you also need to alter the WikiEditor code. Can you explain (in a nutshell) what the "problem" is and if this can be fixed without altering the WikiEditor code. Thanks.

WikiEditor extension (no longer) exposes a convenient public method to create a wikieditor on a given textarea using the normal config. My patch adds such a method. In theory it's possible to do the setup code independently, but it's unnecessarily messy and complicated in my opinion.

@Nikerabbit, thanks for the fix. This also works in MW-1.35.1, PageForms-5.0.1 and WikiEditor-0.5.3

@Nikerabbit - that's great! I plan to add that patch (or something like it) to Page Forms. How difficult would it be to get the WikiEditor patch into the WikiEditor code? Can I help with that?

Technically easy, but needs an approval of the suggested approach from the maintainers. The Maintainers page says that stewards are Contributors > Editing team and Derk-Jan Hartman is a maintainer.

@TheDJ - what do you think about accepting a patch like this into WikiEditor? It would be for use by the Page Forms extension.

Change 655784 had a related patch set uploaded (by Yaron Koren; owner: Yaron Koren):
[mediawiki/extensions/PageForms@master] Re-add WikiEditor support for MW 1.34+ - patch by Nikerabbit

https://gerrit.wikimedia.org/r/655784

Change 655784 merged by jenkins-bot:
[mediawiki/extensions/PageForms@master] Re-add WikiEditor support for MW 1.34+ - patch by Nikerabbit

https://gerrit.wikimedia.org/r/655784

I just added in a change to Page Forms based on Nikerabbit's patch - which should make things easier for administrators, since they now just have to patch only one extension, WikiEditor (to add the addWikiEditor() function). Hopefully, though, WikiEditor can be modified also, so that admins won't have to do anything.

Change 657069 had a related patch set uploaded (by Nikerabbit; owner: Nikerabbit):
[mediawiki/extensions/WikiEditor@master] Export crude public interface for WikiEditor

https://gerrit.wikimedia.org/r/657069

I submitted my hack as a patch to WikiEditor for discussion.

That's great, I hope it gets accepted! It just looks like one change needs to be made to the code: the declaration of the "dialogsConfig" variable should be moved into the new function.

Change 657069 merged by jenkins-bot:
[mediawiki/extensions/WikiEditor@master] Export crude public interface for WikiEditor

https://gerrit.wikimedia.org/r/657069

matmarex assigned this task to Nikerabbit.

Thanks for the patch!

Change 700332 had a related patch set uploaded (by MarkAHershberger; author: Nikerabbit):

[mediawiki/extensions/WikiEditor@REL1_35] Export crude public interface for WikiEditor

https://gerrit.wikimedia.org/r/700332

Change 700333 had a related patch set uploaded (by MarkAHershberger; author: Nikerabbit):

[mediawiki/extensions/WikiEditor@REL1_34] Export crude public interface for WikiEditor

https://gerrit.wikimedia.org/r/700333

Change 700332 merged by jenkins-bot:

[mediawiki/extensions/WikiEditor@REL1_35] Export crude public interface for WikiEditor

https://gerrit.wikimedia.org/r/700332

Change 700333 merged by MarkAHershberger:

[mediawiki/extensions/WikiEditor@REL1_34] Export crude public interface for WikiEditor

https://gerrit.wikimedia.org/r/700333