Last modified: 2008-02-05 11:10:53 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 12759 - Relations pointing to non-semantic pages get broken
Relations pointing to non-semantic pages get broken
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Normal normal with 2 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-01-23 16:55 UTC by Yaron Koren
Modified: 2008-02-05 11:10 UTC (History)
1 user (show)

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


Attachments

Description Yaron Koren 2008-01-23 16:55:36 UTC
Properties of type "Page", i.e. relations, that point to a page that does not have semantics enabled for it get their object_id set to NULL in the smw_relations table in the database, i.e. they become inoperable, when that page is re-saved. This is a problem for Semantic Forms, because form pages don't have semantics enabled, so relations pointing to form pages become broken. The problem happens in the storeData() function in /includes/SMW_Factbox.php, which looks like this:

        static function storeData($processSemantics) {
                // clear data even if semantics are not processed for this namespace
                // (this setting might have been changed, so that data still exists)
                $title = SMWFactbox::$semdata->getSubject();
                if ($processSemantics) {
                        smwfGetStore()->updateData(SMWFactbox::$semdata, SMWFactbox::$m_new);
                } elseif (!SMWFactbox::$m_new) {
                        smwfGetStore()->deleteSubject($title);
                }
        }

When the page is re-saved, storeData() is called on it; $processSemantics is false, and so is the $m_new variable, so deleteSubject() is called on this page; that, in turn, sets the object_id to NULL for all relations pointing to this page.

One easy fix to this problem is to get rid of the "elseif" clause altogether; I don't know if that's the ideal solution, because I don't know what the aim of that deleteSubject() call is - the deleteSubject() function, despite its name, also invalidates relations that have that page as the object.
Comment 1 Markus Krötzsch 2008-02-05 11:10:53 UTC
Should be fixed now. There was also a problem with creating new articles after they were already used as objects. This case also should yield proper IDs in the table now.

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


Navigation
Links