Quantcast

#set does not handle strings with underscores

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

#set does not handle strings with underscores

Neill Mitchell
Hi.

I have the following in a template:

{{#set:Open Link=[[{{PAGENAME}}|{{{from}}} - {{{subject}}} -
{{#sub:{{{date}}}|5|20}}]]}}

If the page name has an underscore in it e.g. [hidden email],
then the #set completely fails. The Open Link string type property is
not set at all. Not even the {{{from}}} - {{{subject}}} -
{{#sub:{{{date}}}|5|20}}]]} part gets set.

Is there a way round this? Surely a #set on a string property should
allow all valid string characters.

Thanks
Neill.



------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: #set does not handle strings with underscores

Neill Mitchell
Same goes for page names with spaces in :(

On 21/02/12 21:50, Neill Mitchell wrote:

> Hi.
>
> I have the following in a template:
>
> {{#set:Open Link=[[{{PAGENAME}}|{{{from}}} - {{{subject}}} -
> {{#sub:{{{date}}}|5|20}}]]}}
>
> If the page name has an underscore in it e.g. [hidden email],
> then the #set completely fails. The Open Link string type property is
> not set at all. Not even the {{{from}}} - {{{subject}}} -
> {{#sub:{{{date}}}|5|20}}]]} part gets set.
>
> Is there a way round this? Surely a #set on a string property should
> allow all valid string characters.
>
> Thanks
> Neill.
>
>
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: #set does not handle strings with underscores

badon
Try this as a workaround:

[[Some property::Some property value| ]]

That should silently annotate the property, and it may avoid the bug in #set. If it works, then it also means that the issue with #set probably should be reported.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: #set does not handle strings with underscores

badon
In reply to this post by Neill Mitchell
I just realized you have a pipe character in there. You need to escape that with a template containing a single pipe character. I recommend Template:! so you would escape the pipe with {{!}}
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: #set does not handle strings with underscores

badon
You should also set null defaults for your parameters. Here's how I would rewrite it:

{{#set:Open Link=[[{{PAGENAME}}{{!}}{{{from|}}} - {{{subject|}}} - {{#sub:{{{date|}}}|5|20}}]]}}

I hope that helps.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: #set does not handle strings with underscores

Neill Mitchell
In reply to this post by badon
Hi.

Thanks for your reply.

Unfortunately this will not work in this case because of the square
brackets around the link I'm forming:
[[{{PAGENAME}}{{!}}{{{from|}}} - {{{subject|}}} -
{{#sub:{{{date|}}}|5|20}}]]

You would have:
[[Open Link::[[{{PAGENAME}}{{!}}{{{from|}}} - {{{subject|}}} -
{{#sub:{{{date|}}}|5|20}}]]]]

Which will not parse.

I need this to work as I am effectively aliasing the raw page name which
is not user friendly with a link of a specific desired format.

Cheers
Neill.

On 21/02/12 22:11, badon wrote:

> Try this as a workaround:
>
> [[Some property::Some property value| ]]
>
> That should silently annotate the property, and it may avoid the bug in
> #set. If it works, then it also means that the issue with #set probably
> should be reported.
>
> --
> View this message in context: http://wikimedia.7.n6.nabble.com/set-does-not-handle-strings-with-underscores-tp4493069p4493118.html
> Sent from the Semantic Mediawiki - User mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: #set does not handle strings with underscores

Neill Mitchell
In reply to this post by badon
Nope, definitely does not work. #set cannot cope with underscores. I've
raised a bug.

Cheers
Neill.

On 21/02/12 22:14, badon wrote:

> You should also set null defaults for your parameters. Here's how I would
> rewrite it:
>
> {{#set:Open Link=[[{{PAGENAME}}{{!}}{{{from|}}} - {{{subject|}}} -
> {{#sub:{{{date|}}}|5|20}}]]}}
>
> I hope that helps.
>
> --
> View this message in context: http://wikimedia.7.n6.nabble.com/set-does-not-handle-strings-with-underscores-tp4493069p4493126.html
> Sent from the Semantic Mediawiki - User mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: #set does not handle strings with underscores

badon
Do you have $smwgLinksInValues = true; configured in your LocalSettings.php?:

http://semantic-mediawiki.org/wiki/Help:Configuration#smwgLinksInValues

Also, what's the URL to your bug report?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: #set does not handle strings with underscores

Neill Mitchell
Yup, I have that set.

Bug is https://bugzilla.wikimedia.org/show_bug.cgi?id=34575

Cheers
Neill.

On 22/02/12 02:58, badon wrote:

> Do you have $smwgLinksInValues = true; configured in your LocalSettings.php?:
>
> http://semantic-mediawiki.org/wiki/Help:Configuration#smwgLinksInValues
>
> Also, what's the URL to your bug report?
>
> --
> View this message in context: http://wikimedia.7.n6.nabble.com/set-does-not-handle-strings-with-underscores-tp4493069p4493587.html
> Sent from the Semantic Mediawiki - User mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Virtualization&  Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Loading...