Author: my.think
Description:
I'm running MediaWiki 1.20 and SMW 1.8.4, newly setup testing wiki.
TextProperty is a normal Property (type String), RecordProperty is a Record, properly set-up with their own properties, and types, in this case: Page;Number.
This:
{{#subobject: Test
TextProperty = Test |
RecordProperty = Testing;123 |
}}
{{#subobject: Test
TextProperty = Test2 |
}}
works without flaws, and adds everything to the same subobject, just as #set still works when used multiple times with the same properties.
Now, if I move the RecordProperty declaration to the 2nd #subobject, the wiki will error out with an exception:
{{#subobject: Test
TextProperty = Test |
}}
{{#subobject: Test
TextProperty = Test2 |
RecordProperty = Testing;123 |
}}
Cannot add subdata. Are you trying to add data to an SMWSemanticData object that is already used as a subdata object?
Backtrace:
#0 .../extensions/SemanticMediaWiki/includes/SMW_SemanticData.php(442)<...>: SMWSemanticData->addSubSemanticData(Object(SMWContainerSemanticData))
I don't exactly know what SMWSemanticData objects are supposed to be (are subobjects?), and what the notion of subdata objects is in this context, and the documentation was a little unhelpful regarding that, too, so I can't say if what the error message really says is what I am doing there.
In 1.7, this worked fine, and would add the record data to the Trash subobject just fine. Am I doing anything that just worked because I was lucky (I supposed the behavior for #set and #subobject was intended to be the same) or is there a deeper bug to this? If at all, this error case should be handled more gracefully than throwing an exception.
I'm using templates on the wiki to hide all the SMW magic, and being able to declare the SMW subobject data in multiple calls to #subobject helps to keep their source code tidier.
Version: unspecified
Severity: normal