Last modified: 2013-02-20 13:52:32 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 T47188, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 45188 - addPropertyObjectValue throws error
addPropertyObjectValue throws error
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
REL1_20-branch
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-20 06:55 UTC by Hans Meiser
Modified: 2013-02-20 13:52 UTC (History)
4 users (show)

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


Attachments

Description Hans Meiser 2013-02-20 06:55:50 UTC
AddPropertyObjectValue throws MySQL errors (column not found blob etc.) while using custom PHP-driven properties in SMW 1.8.x. This doesn't happen in 1.7.x. but makes an SMW-update system critical, because it crashes a complete Wiki when someone tries to edit. I tested this behavior with SMW 1.7.1, 1.8.2, 1.8.3

c u steve
Comment 1 MWJames 2013-02-20 10:35:00 UTC
(In reply to comment #0)
> AddPropertyObjectValue throws MySQL errors (column not found blob etc.) while

If you do report an issue [0], please report the exact error (with stack trace, error message etc. [1]) and the version used (MW, PHP, SMW etc. see [2]) otherwise this issue is insufficient in its description and will most likely be closed.

> using custom PHP-driven properties in SMW 1.8.x. This doesn't happen in
> 1.7.x.

If you do use custom development, please ensure that your procedures conform with the environment necessary to execute MW/SMW-core functions.

[0] http://www.semantic-mediawiki.org/wiki/Help:Reporting_bugs

[1] http://www.semantic-mediawiki.org/wiki/Stack_trace

[2] http://www.semantic-mediawiki.org/wiki/Special:Version
Comment 2 Hans Meiser 2013-02-20 10:55:26 UTC
In this case I had to downgrade to SMW 1.7.1 which cost me alot of time. Then I made this bug report. I can't reproduce the exact message from shell (I triggered it on shell with SMW_refreshData.php) because I m now using an older version which all its dependencies. But I'm sure the SMW-team knows what happens... there is obviosly a inconsistency between the database structure and the code. "column not found" is a standard MySQL-Message. This bug will affect other extensions too, like Semantic Extra Special Properties which currently relies on SMW 1.7. So I'm sure someone will fix it :-).
Comment 3 MWJames 2013-02-20 11:02:07 UTC
(In reply to comment #2)
> version which all its dependencies. But I'm sure the SMW-team knows what
> happens... there is obviosly a inconsistency between the database structure

This is a misconception, if the error is unknown (it also means if the description is insufficient, nothing is obvious no matter how trivial it seems) no one will and can spent time on this as it is not clear how to reproduce the error and test it against a change to verify that the error is gone.
Comment 4 Hans Meiser 2013-02-20 11:08:03 UTC
Wait a minute, I will change the complete system to show you the original message.
Comment 5 Hans Meiser 2013-02-20 11:39:14 UTC
For your convenience

minor:
<code>
<b>Deprecated</b>:  Use of User::editToken was deprecated in MediaWiki 1.19. [Called from SFFormEdit::printForm in Q:\flampp\htdocs\schnatzikutzki\extensions\SemanticForms\specials\SF_FormEdit.php at line 323] in <b>Q:\flampp\htdocs\schnatzikutzki\includes\debug\Debug.php</b> on line <b>282</b>
</code>

major from the MW-GUI while saving the edit form:

INSERT INTO `smw_di_blob` (s_id,p_id,o_blob,o_hash) VALUES ('145','144',NULL,'Hans'),('145','150','156'),('145','152',NULL,'Hans')
 from within function "SMW::writePropertyTableRowUpdates-insert-smw_di_blob". Database returned error "1136: Column count doesn't match value count at row 2 (localhost)".

major from shell (triggered by SMW_refreshData.php):

A database query syntax error has occurred.
The last attempted database query was:
"INSERT  INTO `smw_di_blob` (s_id,p_id,o_id) VALUES ('51','150','151'),('51','152
from within function "SMW::writePropertyTableRowUpdates-insert-smw_di_blob".
Database returned error "1054: Unknown column 'o_id' in 'field list' (localhost)"

I use the same code as the guys in Semantic Extra Special Properties in the propper handler:

<code>

SMWDIProperty::registerProperty('___ABCED', '_str','ABC Document Edited By',true);
        SMWDIProperty::registerPropertyAlias('___SDWED', 'ABC_Document_Edited_By');

[...]

        $user = $wgUser->getName();  
        $property = new SMWDIProperty('___SDWED');
        $dataItem = new SMWDIString($user);
        $data->addPropertyObjectValue($property, $dataItem);

</code>

For this reproduction I switched to MW 1.20.2 + SMW 1.8.2

By the way could you please release my other bug reports?
Comment 6 MWJames 2013-02-20 11:57:55 UTC
(In reply to comment #5)
> <b>Deprecated</b>:  Use of User::editToken was deprecated in MediaWiki 1.19.
> [Called from SFFormEdit::printForm in
> Q:
> \flampp\htdocs\schnatzikutzki\extensions\SemanticForms\specials\SF_FormEdit.
> php
> at line 323] in
> <b>Q:\flampp\htdocs\schnatzikutzki\includes\debug\Debug.php</b>
> on line <b>282</b>
> </code>
No relevant to the case.
 
> I use the same code as the guys in Semantic Extra Special Properties in the
> propper handler:
> 
> <code>
> 
> SMWDIProperty::registerProperty('___ABCED', '_str','ABC Document Edited
> By',true);

That this means that the error is thrown because you wrote your own function? Since addPropertyObjectValue (as part of the SMWSemanticData Class) is used with in SMW/SRF core without issues and no reproducible error, I can't see why this is an error of SMW. For help on how to use addPropertyObjectValue, please use [1]. (Bugzilla shouldn't not be used to seek developer advice on self developed implementations.)

[1] http://semantic-mediawiki.org/doc/classSMWSemanticData.html
Comment 7 Hans Meiser 2013-02-20 12:14:04 UTC
Ok If this is not a bug. Then its a lack of documentation. The class reference doesnt show up any relevant changes. So we can't write SMW-Data with PHP anymore.
Comment 8 MWJames 2013-02-20 12:27:18 UTC
(In reply to comment #7)
> Ok If this is not a bug. Then its a lack of documentation. The class
> reference
Lack of documentation? Please keep in mind SMW is a volunteer project and it can only grow with participation. If you find document is insufficient, help to improve (open a new chapter and if a core-developer finds the time he/she might comment on it, please don't expect them to do all the work)

> doesnt show up any relevant changes. So we can't write SMW-Data with PHP
> anymore.
Just because is doesn't seemed obvious, does not make it nullified. See [1] how to use addPropertyObjectValue in a different context (is used in SMW 1.9 but is the same as in SMW 1.8)

[1] http://semantic-mediawiki.org/doc/SubobjectParser_8php_source.html#l00034
Comment 9 Hans Meiser 2013-02-20 12:28:47 UTC
Tried to post it to the mailinglist. The message was truncated and finally trashed.
Comment 10 Hans Meiser 2013-02-20 12:46:45 UTC
Yes OK, but the question is how to port this to a 
$wgHooks['SMWStore::updateDataBefore'][] - handler

The documentation says this:

http://www.semantic-mediawiki.org/wiki/SMW_Hooks/SMWStore::updateDataBefore

...unfortunately its not enough to get creative ;-).
Comment 11 Hans Meiser 2013-02-20 13:52:32 UTC
OK, just for clearing. It was a type problem '_wpg' vs. '_str' which causes this mysql errors. And indeed I never would expect such side effects. So it was no technical bug. It was a missunderstanding. I feel so sorry now ;-)...but I also spent two days with this issues.

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


Navigation
Links