r41432 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41431‎ | r41432 | r41433 >
Date:17:23, 30 September 2008
Author:mkroetzsch
Status:old (Comments)
Tags:
Comment:
prevent errors in MW <= 1.13 (it still won't work there since LinkUpdate has no access to ParserOutput in those versions, we will look for a
solution ...)
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_ParseData.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_ParseData.php
@@ -20,7 +20,11 @@
2121 * a new empty container if it is not initiated yet.
2222 */
2323 static public function getSMWdata(Parser $parser) {
24 - $output = $parser->getOutput();
 24+ if (method_exists($parser,'getOutput')) {
 25+ $output = $parser->getOutput();
 26+ } else {
 27+ $output = $parser->mOutput;
 28+ }
2529 $title = $parser->getTitle();
2630 if (!isset($output) || !isset($title)) return NULL; // no parsing, create error
2731 if (!isset($output->mSMWData)) { // no data container yet
@@ -35,7 +39,11 @@
3640 * Clear all stored data for a given parser.
3741 */
3842 static public function clearStorage(Parser $parser) {
39 - $output = $parser->getOutput();
 43+ if (method_exists($parser,'getOutput')) {
 44+ $output = $parser->getOutput();
 45+ } else {
 46+ $output = $parser->mOutput;
 47+ }
4048 $title = $parser->getTitle();
4149 if (!isset($output) || !isset($title)) return;
4250 $dv = SMWDataValueFactory::newTypeIDValue('_wpg');
@@ -160,7 +168,9 @@
161169 }
162170 }
163171 }
164 -
 172+debug_zval_dump($processSemantics);
 173+debug_zval_dump($semdata);
 174+die;
165175 // Actually store semantic data, or at least clear it if needed
166176 if ($processSemantics) {
167177 smwfGetStore()->updateData($semdata, SMWFactbox::isNewArticle());

Comments

#Comment by Brion VIBBER (talk | contribs)   01:11, 1 October 2008

Debug code removed in r41433.

Status & tagging log