Last modified: 2011-08-15 13:57:27 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 T31958, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29958 - Semantic Forms needs to exit gracefully if SMW is not included first
Semantic Forms needs to exit gracefully if SMW is not included first
Status: RESOLVED FIXED
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: 2011-07-18 18:40 UTC by Andrew Berridge
Modified: 2011-08-15 13:57 UTC (History)
1 user (show)

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


Attachments

Description Andrew Berridge 2011-07-18 18:40:03 UTC
SQL error generated from includes/parser/LinkHolderArray.php:

SELECT page_id, page_namespace, page_title, page_is_redirect, page_len, page_latest FROM `wiki_page` WHERE (page_namespace=SF_NS_FORM 

Obviously this is not right because there are no quotes round the namespace.

See lines: 187, 190 of includes/parser/LinkHolderArray.php
And similar in: includes/parser/Parser_OldPP.php

I'm not sure how these files work and where they come into play or what they do, but all I know is that adding quotes round $ns stopped the SQL error on my install on MediaWiki 1.17.0 with SMW 1.5.6 and Semantic Forms 2.1.2

Andrew
Comment 1 Sam Reed (reedy) 2011-07-18 18:41:43 UTC
(In reply to comment #0)
> 
> Obviously this is not right because there are no quotes round the namespace.
> 

Not really, it should've been a substituted constant by the look of this, which I'm presuming it's a SF bug
Comment 2 Yaron Koren 2011-07-18 22:18:05 UTC
Hi Andrew - what page are you on when you see this error?
Comment 3 Andrew Berridge 2011-07-18 22:54:03 UTC
Hi Yaron,

It varies - it doesn't seem consistent, but it does seem to be some pages on which there is a SMW query. I'm actually wondering whether it's happening because I've just upgraded and there's something funny going on with the cache. 

So, I've found a page:

r5gordini.co.uk/mediawiki/Renault_5_Gordini_Turbo">http://www.r5gordini.co.uk/mediawiki/Renault_5_Gordini_Turbo

It's got an SMW query on it. However, here's another page that has the same query that works fine:

r5gordini.co.uk/mediawiki/Renault_Super_5_GT_Turbo_Phase_I">http://www.r5gordini.co.uk/mediawiki/Renault_Super_5_GT_Turbo_Phase_I

Thanks,

Andrew
Comment 4 Yaron Koren 2011-07-19 00:38:14 UTC
I don't know - that's very strange. If possible, can you upgrade to the latest SF version, 2.2, and see if the problem persists?
Comment 5 Andrew Berridge 2011-07-20 10:00:24 UTC
Hi Yaron, I see that my links have been obfuscated above. 0 or 1 need to be substituted with r5, but I think you know that from our previous discussions!

I have upgraded to 2.2. It doesn't fix the issue. If it helps, I am able to open a page with this error for edit but saved changes do not take effect.

More info:

The overarching category uses Has default form, but when I go to a page and Edit With Form, I get:

Warning: This page already exists, but it does not use this form.

This didn't happen previously!

Any ideas where I could look for the variable substitution for the Namespace?

I want to help fix this issue.

Thanks,

Andrew
Comment 6 Andrew Berridge 2011-07-20 10:06:53 UTC
Eeek! Something's not right with the Forms namespace elsewhere too... Going to Special:Forms shows an empty namespace. Of course, it doesn't help that one of my users has accidentally overwritten the Form with some text. The old text of the form doesn't show up in the history, so I may have to create it from scratch.

The forms show as:

:Car Record

(for example).

Andrew
Comment 7 Andrew Berridge 2011-07-20 12:31:50 UTC
Hi Yaron,

Further to my comments above, I have done some more investigation. 

The example code:

print "NS_FORM:" . SF_NS_FORM, shows NS_FORM:106

And:

in specials/SF_Forms.php, function formatResult:

$title = Title::makeTitle(SF_NS_FORM, $result->value );

$title becomes ":Form_Name" - no namespace.

It's like the translation from 106 to "Forms" is not working. I will continue my investigations when I have time.

Thanks,

Andrew
Comment 8 Andrew Berridge 2011-07-23 19:55:47 UTC
Hi Yaron,

OK! Well, I've fixed it. Turns out it was my mistake, as is usual with these things. I'd included SemanticForms before Semantic MediaWiki! All the Namespace stuff is set up in Semantic MediaWiki, not Semantic Forms. Obvious really, when I think about it, but I didn't find it that easy to troubleshoot as I was looking for the NS defines in Semantic Forms - didn't think to look for them in SMW.

Well, I've learnt something today ;-)

Might I suggest some error trapping in SF so that if the namespace isn't defined we know that the prerequisite of SMW isn't present yet?

Thanks for your responses to this. I will let you do as you wish with the bug report - could it feed into an enhancement to display an error if SMW not present before SF?


Andrew
Comment 9 Yaron Koren 2011-07-25 19:31:13 UTC
Hi Andrew - good detective work! Evidently, the check within SF, to see if SMW has already been included, no longer works with newer versions of MW and/or SMW. I'm keeping the bug active, but renaming it to "Semantic Forms needs to exit gracefully if SMW is not included first".
Comment 10 Yaron Koren 2011-08-15 13:57:27 UTC
I checked in a fix for this in SVN.

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


Navigation
Links