Last modified: 2012-12-02 15:39:57 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 T44347, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 42347 - Form fails on SMW 1.8 #ask
Form fails on SMW 1.8 #ask
Status: RESOLVED WORKSFORME
Product: MediaWiki extensions
Classification: Unclassified
SemanticForms (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Yaron Koren
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-22 07:08 UTC by Ad Strack van Schijndel
Modified: 2012-12-02 15:39 UTC (History)
6 users (show)

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


Attachments

Description Ad Strack van Schijndel 2012-11-22 07:08:20 UTC
A project form uses {{#ask: [[Category:Project]] |?Project number | format=max }} to determine the current highest project number.

The form fails - a white screen appears after a long while instead of the form to appear - when the project is edited with form. 

The 'ask' showed above seems to be the cause of the problem, since the form shows promptly when it is removed from the form definition. Also the problem doesn't occur with SMW 1.7.1 in combination with SF 2.5.1.

The problem occurs with SMW 1.8 beta 2. Other versions are: MW 1.19.2, SF 2.5.1, SRF 1.8 rc2.
Comment 1 Markus Krötzsch 2012-11-22 09:15:40 UTC
Please try the following query instead:

{{#ask: [[Category:Project]]
| ?Project number=
| mainlabel=-
| sort=Project number
| order=DESC
| limit=1
}}

and compare its result with the result of your original query (if you can get it at all). Please let us know if this works.
Comment 2 Ad Strack van Schijndel 2012-11-22 11:15:36 UTC
Ok I did what you suggested and did some additional research. The interesting results I think are:

{{{field|Project number|default= {{#expr: {{#ask: [[Category:Project]]
    | ?Project number
    | format=max
  }} + 1}} 
 }}} 

shows '{{#expr: {{#ask:' in the project number field when creating a new project (NOK) and
works well when editing a project with the form (OK).

The original statement: {{{field|Project number|default= {{#expr: {{#ask: [[Category:Project]] | ?Project number | format=max }} + 1}} }}}
which is exactly the same, only the whole 'field' statement on one line,

shows the correct (next) project number when creating a new project (OK) and
causes the form to fail (white screen after long while) when editing the project (NOK)
Comment 3 Markus Krötzsch 2012-11-22 11:32:01 UTC
If the query that I suggested works for you, it is highly recommended to use this query instead of format=max everywhere. Similarly for format min (but change the order to ASC there). If you want to do math with the result, you should also specify that you do not want any formatting by adding a #-:

{{#ask: [[Category:Project]]
| ?Project number#-=
| mainlabel=-
| sort=Project number
| order=DESC
| limit=1
}}

The max format should be avoided whenever possible. It is very resource intensive (possibly retrieving thousands of results to find one number) and may still lead to wrong results (if there are too many matches).

The other problem you mention here seem to be related to {{{field}}} but not to SMW. I don't see why there should be a connection to SMW 1.8, but maybe there were some small output changes in #ask that your code is somehow sensitive to. I am reassigning this bug to SF now.
Comment 4 Ad Strack van Schijndel 2012-11-22 12:42:16 UTC
The query you suggested shows the same results - with the addition of 'search label=' or the result includes ...further results, which is hard to use in calculations.

This means the creation of a new project works fine and editing fails.
Comment 5 Ad Strack van Schijndel 2012-12-02 09:01:34 UTC
My hosting provider migrated to php 5.3.19 and the problems don't appear anymore.
It seems that the problem is related to (very) old php versions and new versions of the extensions.
Since php 5.2 is not supported anymore in the next version of SMW 'unconfirmed' seems appropriate to me.
Comment 6 Nischay Nahata 2012-12-02 14:49:24 UTC
Marking as Invalid for now; only one person had the problem and it worked for him
Comment 7 Andre Klapper 2012-12-02 14:55:16 UTC
Sounds more like WORKSFORME then... :)
Comment 8 Ad Strack van Schijndel 2012-12-02 15:39:57 UTC
You guys can do things with the status that wouldn't even have dreamed of ;-)

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


Navigation
Links