Index: trunk/extensions/RDFIO/specials/SpecialRDFImport_body.php |
— | — | @@ -29,6 +29,7 @@ |
30 | 30 | |
31 | 31 | $this->setHeaders(); |
32 | 32 | $this->handleRequestData(); |
| 33 | + $showscreensonly = false; |
33 | 34 | |
34 | 35 | if ( $this->m_action == 'Import' ) { |
35 | 36 | if ( !$wgUser->matchEditToken( $this->m_edittoken ) ) { |
Index: trunk/extensions/RDFIO/classes/PageHandler.php |
— | — | @@ -46,9 +46,11 @@ |
47 | 47 | $properties = $this->m_properties; |
48 | 48 | foreach ( $properties as $cur_prop ) { |
49 | 49 | $propertystring = $cur_prop['p']; |
50 | | - $property = SMWPropertyValue::makeUserProperty( $propertystring ); |
| 50 | + // TODO: Remove old code: |
| 51 | + // $property = SMWPropertyValue::makeUserProperty( $propertystring ); |
| 52 | + $property_di = SMWDIProperty::newFromUserLabel($propertystring); |
51 | 53 | $valuestring = RDFIOUtils::sanitizeSMWValue( $cur_prop['v'] ); |
52 | | - $value = SMWDataValueFactory::newPropertyObjectValue( $property, $valuestring ); |
| 54 | + $value = SMWDataValueFactory::newPropertyObjectValue( $property_di, $valuestring ); |
53 | 55 | |
54 | 56 | $propertyErrorText = $property->getErrorText(); |
55 | 57 | $propertyHasError = ( $propertyErrorText != '' ); |
— | — | @@ -161,16 +163,25 @@ |
162 | 164 | */ |
163 | 165 | private function initSMWWriter( $delete = false ) { |
164 | 166 | // Create add and remove objects, to use in SMWWriter calls |
165 | | - $page = SMWWikiPageValue::makePage( $this->m_wikititle, $this->m_ns ); |
| 167 | + |
| 168 | + // TODO: Should rather use (but not possible with current SMWWriter API?): |
| 169 | + // $page_di = SMWDIWikiPage::newFromTitle( Title::makeTitle($this->m_ns, $this->m_wikititle) ); |
| 170 | + $page = SMWWikiPageValue::makePage( $this->m_wikititle, $this->m_ns ); |
| 171 | + $page_di = $page->getDataItem(); |
| 172 | + $page_data = new SMWSemanticData( $page_di ); |
| 173 | + |
| 174 | + $dummypage = SMWWikiPageValue::makePage( false, $this->m_ns ); |
| 175 | + $dummypage_di = $dummypage->getDataItem(); |
| 176 | + $dummypag_data = new SMWSemanticData( $dummypage_di ); |
| 177 | + |
| 178 | + |
166 | 179 | $this->m_smwwriter = new SMWWriter( $page->getTitle() ); |
167 | 180 | if ( $delete ) { |
168 | | - // We are not adding anything, so create a "page" with "false" title |
169 | | - $this->m_smwwriter_add = new SMWSemanticData( SMWWikiPageValue::makePage( false, $this->m_ns ) ); |
170 | | - $this->m_smwwriter_remove = new SMWSemanticData( $page ); |
| 181 | + $this->m_smwwriter_add = $page_data; |
| 182 | + $this->m_smwwriter_remove = $dummypag_data; |
171 | 183 | } else { |
172 | | - $this->m_smwwriter_add = new SMWSemanticData( $page ); |
173 | | - // We are not removing anything, so create a "page" with "false" title |
174 | | - $this->m_smwwriter_remove = new SMWSemanticData( SMWWikiPageValue::makePage( false, $this->m_ns ) ); |
| 184 | + $this->m_smwwriter_add = $dummypag_data; |
| 185 | + $this->m_smwwriter_remove = $page_data; |
175 | 186 | } |
176 | 187 | } |
177 | 188 | |
Index: trunk/extensions/RDFIO/classes/SMWBatchWriter.php |
— | — | @@ -60,12 +60,12 @@ |
61 | 61 | |
62 | 62 | // Previously in Equiv URI Class |
63 | 63 | |
64 | | - if ( $rdfiogUsePseudoNamespacesForProperties != '' ) { // TODO: Change to check options from import screen |
| 64 | + if ( isset($rdfiogUsePseudoNamespacesForProperties) ) { // TODO: Change to check options from import screen |
65 | 65 | // use parameter set in LocalSettings.php |
66 | 66 | $this->m_usenspintitles_properties = $rdfiogUsePseudoNamespacesForProperties; |
67 | 67 | } |
68 | 68 | |
69 | | - if ( $rdfiogUsePseudoNamespacesForEntities != '' ) { |
| 69 | + if ( isset($rdfiogUsePseudoNamespacesForEntities) ) { |
70 | 70 | // use parameter set in LocalSettings.php |
71 | 71 | $this->m_usenspintitles_entities = $rdfiogUsePseudoNamespacesForEntities; |
72 | 72 | } |
Index: trunk/extensions/RDFIO/classes/RDFStore.php |
— | — | @@ -53,6 +53,10 @@ |
54 | 54 | $rs = $store->query( $q ); |
55 | 55 | if ( !$store->getErrors() ) { |
56 | 56 | $rows = $rs['result']['rows']; |
| 57 | + // @todo FIXME: Handle this case more nicely |
| 58 | + if (count($rows) == 0) { |
| 59 | + die( "No rows returned" ); |
| 60 | + } |
57 | 61 | $row = $rows[0]; |
58 | 62 | $origuri = $row['origuri']; |
59 | 63 | } else { |