Last modified: 2011-01-30 16:02:25 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T29039, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 27039 - #ask and #show parser functions have leading and trailing white space
#ask and #show parser functions have leading and trailing white space
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Normal minor (vote)
: ---
Assigned To: Markus Krötzsch
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-30 04:41 UTC by John Morton
Modified: 2011-01-30 16:02 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description John Morton 2011-01-30 04:41:55 UTC
Background: I'm using a global setting page for a news package, and one of the setting set on that page is the namespace for new news entries. 

The news entry form is set up thus:

{{#forminput:form=CFFC News Entry|query string=namespace={{#show: CFFC News Global Settings | ?CFFC News Namespace# -}}}}

The problem is, the output form looks like this:

<p><input type="text" name="page_name" size="25" value="" class="formInput" />
<input type="hidden" name="form" value="CFFC News Entry">
<input type="hidden" name="namespace" value="&#9;&#9;&#9;&#9;&#10;&#9;&#9;&#9;&#9;&#9;News" />
<input type="submit" value="Create or edit" /></p>
<p>			</form>

All that leading noise in the namespace value results in a page name that can't be created.

The ideal solution would be to have #show, at least, strip leading and trailing white space, however that may have formatting consequences for people who've written, “some text{{#show: ...}}some other text”, and had white space inserted. 

For the time being, a work around I'm using is to pack the #show inside padleft, with the padding set to zero:

{{#forminput:form=CFFC News Entry|query string=namespace={{padleft:{{#show: CFFC News Global Settings | ?CFFC News Namespace# -}}|0}}}}
Comment 1 Jeroen De Dauw 2011-01-30 14:53:11 UTC
What version of SMW are you using? Can you link to where this is occurring? If not, can you replicate it on a public wiki?
Comment 2 John Morton 2011-01-30 15:38:52 UTC
Semantic Bundle Version 0.6.20101202, so SMW 1.5.4. I see I'm out of date! 

Here's a test page:

http://chch.ultimate.org.nz/wiki/view/User:Jwm/sandbox

I'll upgrade in the next day and test again.
Comment 3 Jeroen De Dauw 2011-01-30 16:02:25 UTC
SMW 1.5.4 contained a whitespace issue, which has been fixed in 1.5.5.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links