Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiRecordSets.php |
— | — | @@ -338,12 +338,17 @@ |
339 | 339 | |
340 | 340 | for ($i = 0; $i < $recordSet->getRecordCount(); $i++) { |
341 | 341 | $record = $recordSet->getRecord($i); |
342 | | - # FIXME - check for empty values |
343 | | - foreach($textAttributes as $textAttribute) |
344 | | - $record->setAttributeValue( |
345 | | - $textAttribute, |
346 | | - @$textReferences[$record->getAttributeValue($textAttribute)] |
347 | | - ); |
| 342 | + |
| 343 | + foreach($textAttributes as $textAttribute) { |
| 344 | + $textId = $record->getAttributeValue($textAttribute); |
| 345 | + |
| 346 | + if (isset($textReferences[$textId])) |
| 347 | + $textValue = $textReferences[$textId]; |
| 348 | + else |
| 349 | + $textValue = ""; |
| 350 | + |
| 351 | + $record->setAttributeValue($textAttribute, $textValue); |
| 352 | + } |
348 | 353 | } |
349 | 354 | } |
350 | 355 | |
— | — | @@ -750,8 +755,7 @@ |
751 | 756 | if (count($objectIds) > 0) { |
752 | 757 | for ($i = 0; $i < count($objectIds); $i++) { |
753 | 758 | $record = new ArrayRecord($objectAttributesRecordStructure); |
754 | | - #FIXME- check value |
755 | | - @$objectAttributesRecords[$objectIds[$i]] = $record; |
| 759 | + $objectAttributesRecords[$objectIds[$i]] = $record; |
756 | 760 | } |
757 | 761 | |
758 | 762 | // Text attributes |
— | — | @@ -799,29 +803,28 @@ |
800 | 804 | $record = $recordSet->getRecord($i); |
801 | 805 | $objectId = $record->getAttributeValue($objectIdAttribute); |
802 | 806 | |
803 | | - // FIXME: Do some checks whether these values actually exist |
804 | 807 | // Text attributes |
805 | | - @$textAttributeValuesRecordSet = $textAttributeValuesRecordSets[$objectId]; |
806 | | - |
807 | | - if ($textAttributeValuesRecordSet == null) |
| 808 | + if (isset($textAttributeValuesRecordSets[$objectId])) |
| 809 | + $textAttributeValuesRecordSet = $textAttributeValuesRecordSets[$objectId]; |
| 810 | + else |
808 | 811 | $textAttributeValuesRecordSet = $emptyTextAttributesRecordSet; |
809 | 812 | |
810 | 813 | // Translated text attributes |
811 | | - @$translatedTextAttributeValuesRecordSet = $translatedTextAttributeValuesRecordSets[$objectId]; |
812 | | - |
813 | | - if ($translatedTextAttributeValuesRecordSet == null) |
| 814 | + if (isset($translatedTextAttributeValuesRecordSets[$objectId])) |
| 815 | + $translatedTextAttributeValuesRecordSet = $translatedTextAttributeValuesRecordSets[$objectId]; |
| 816 | + else |
814 | 817 | $translatedTextAttributeValuesRecordSet = $emptyTranslatedTextAttributesRecordSet; |
815 | 818 | |
816 | 819 | // URL attributes |
817 | | - @$urlAttributeValuesRecordSet = $urlAttributeValuesRecordSets[$objectId]; |
818 | | - |
819 | | - if ($urlAttributeValuesRecordSet == null) |
| 820 | + if (isset($urlAttributeValuesRecordSets[$objectId])) |
| 821 | + $urlAttributeValuesRecordSet = $urlAttributeValuesRecordSets[$objectId]; |
| 822 | + else |
820 | 823 | $urlAttributeValuesRecordSet = $emptyURLAttributesRecordSet; |
821 | 824 | |
822 | 825 | // Option attributes |
823 | | - @$optionAttributeValuesRecordSet = $optionAttributeValuesRecordSets[$objectId]; |
824 | | - |
825 | | - if ($optionAttributeValuesRecordSet == null) |
| 826 | + if (isset($optionAttributeValuesRecordSets[$objectId])) |
| 827 | + $optionAttributeValuesRecordSet = $optionAttributeValuesRecordSets[$objectId]; |
| 828 | + else |
826 | 829 | $optionAttributeValuesRecordSet = $emptyOptionAttributesRecordSet; |
827 | 830 | |
828 | 831 | $objectAttributesRecord = new ArrayRecord($objectAttributesRecordStructure); |