Page MenuHomePhabricator

formlink query string broke line with apostrophe in {{PAGENAME}}
Closed, ResolvedPublic

Description

Author: dvdgmz

Description:
If we have a button like this:

{{#formlink:form=Activitat|New activity|link
type=button|query string=Activitat[Obra]={{PAGENAME}} }}

When the title of the page have an apostrophe or single quote, like in this case:

Stuka's shadow by Hernández

the text appears broken just behind the apostrophe in the form field
'Obra'.

{{PAGENAMEE}} it's not an option because it put underscores instead of spaces.

It seems to work well in old versions of SF but not in 2.3 version.


Version: unspecified
Severity: major
OS: Linux

Details

Reference
bz33771

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 12:04 AM
bzimport set Reference to bz33771.

mitchell_neill wrote:

This is a regression since version 2.1. It used to work fine.

Apostrophes are a very common character to use in page names, so it would be great if this could be fixed.

Thanks
Neill.

Changed "value" to "{{PAGENAME}}" in bug title, for clarity.

I think this is fixed now in SVN.

dvdgmz wrote:

Yes it works well with the version in SVN.
But now it stops HeaderTabs. Only when there is an apostrophe.

Sorry, what do you mean by that? And can you link to an example?

dvdgmz wrote:

The firts time I tested didn't load the HeaderTabs in the form.
But now I can't reproduce that.

It seems that works well :)

Awesome! My favorite kind of bug report. :)

I'm setting this to "fixed"; if you find a problem, though, feel free to re-open it.

mitchell_neill wrote:

I've just tried this and when I click the formlink button it throws the following error:
Fatal error: Call to undefined method Html::closeelement() in /home/webapps/wiki/extensions/SemanticForms/includes/forminputs/SF_RadioButtonInput.php on line 97

This is with revision 109354.

Cheers
Neill.

Pascal.Beaujeant wrote:

I suspect this bug is related to the international characters management in some (or all) semantic tools.

Indeed, at the beginning, I'm working with MW version 1.16 and I have the problem to manage accentuated characters (as in French). At the beginning, I'm running MW 1.16 and Yaron give me the solution :

28 Jun 2011 à 23:52, Yaron Koren a écrit :

Hi,

Ah, your wiki is public - you should have mentioned that before; that definitely makes debugging easier. I think I found the problem - there's a bug in Special:CreateTemplate (and Special:CreateForm), that prevents it from working in wikis that are in certain non-English languages. I think this can best be fixed by removing line 198 from /specials/SF_CreateTemplate.php - the line that looks like:

$text .= "\t" . Html::hidden( 'title', SFUtils::titleURLString( $ct ) ) . "\n";

If you just delete that line, it should work...

In /specials/SF_CreateForm.php, there's a similar line that should be removed: line 224.

When I'm upgrade to 1.17, the problems seems to be again there. And I try the patch given by Yaron without success at this time. (I presume I need to upgrade to 1.18???) :

04 Jan 2012 à 23:16, Yaron Koren a écrit :

It looks like those lines are still there in SF_CreateTemplate.php and SF_CreateForm.php; they just got rewritten at all. They now look like:

$text .= SFFormUtils::hiddenFieldHTML( 'title', $this->getTitle()->getPrefixedText() );

It's line 188 in SF_CreateTemplate.php and line 221 in SF_CreateForm.php.

You can just comment those out again. The reason I didn't remove those is that sometimes they're necessary - if the wiki doesn't have a good URL structure. Ideally, there could be code that works for all cases, but I guess I haven't looked into the issue enough.

-Yaron

I have some bugs related to this bugzillia.
Indeed, with SemanticGraph extension and the timeline graph generated doesn't give the correct link but instead a link to a page limited at the first apostrophe.

I get the same with HeaderTabs but also the HeaderTabs doesn't run where the jump to the part of the form with a First level accentuated title doesn't run.

I suspect a basement problem with non english caracters.
Friday, I upgrade mediawiki to 1.18 and Semantic Bundle associated.

These are all unrelated problems - I'm marking this bug as fixed again.

mitchell_neill wrote:

Yup, just checked new revision 109364 and it works :)

That's nice, but - again, separate issue.

dvdgmz wrote:

After of adding this SF version my wiki seems to have a strange behaviour in some aspects, maybe related with JavaScript and/or css.

Here, for example:
http://lletra.uoc.edu/viquilletra/index.php?title=Usuari:BadCompany&action=formedit

"show on select=" don't work (the divs are shown).

And here:
http://lletra.uoc.edu/viquilletra/index.php?title=Anunci_de_La_pell_freda,_per_Nike&action=formedit

The HeaderTabs don't load. And the autocomplete don't works.

But here (strange) works:
http://lletra.uoc.edu/viquilletra/index.php?title=Ant%C3%ADgona_de_Salvador_Espriu&action=formedit

The problem is with some forms but not with others.
And all these forms worked well (except the problem with apostrophe) in previous version.

:/

dvdgmz wrote:

All the forms with this problem has the wikieditor param in some field.
It should to be a separate bug?

Yes, it should have been a separate bug. :) In any case, I just fixed it now in SVN, I think.