https://bugzilla.wikimedia.org/show_bug.cgi?id=33901

       Web browser: ---
             Bug #: 33901
           Summary: Empty properties not ignored in subobjects
           Product: MediaWiki extensions
           Version: any
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Semantic MediaWiki
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


Created attachment 9892
  --> https://bugzilla.wikimedia.org/attachment.cgi?id=9892
Patch for SMW_Subobject.php

Hi,

Empty properties in Subobjects create an error saying that an Attribute value
can't be empty.

This use case can easily occur when declaring subobjects trough Forms/Templates
since you would specify each property, which could end with an empty parameter
value:

{{#subobject:DeliveryAddress| In_Country=United States | In_State= New York}}

{{#subobject:DeliveryAddress| In_Country=Luxembourg | In_State= }}


The source code's comments in SMW_Subobject.php seem to indicate that
properties with empty values were supposed to be correctly ignored, but testing
the number of parameters got after a split on the "=" character is not enought
since there will be 2 elements in the resulting array, the latter being an
empty string.

Quick patch joined.

Mediawiki 1.17, Semantic Mediawiki 1.7

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to