Now using page_id to display reports. This avoids that reports are gone when the...
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Mon, 23 Jan 2017 22:04:17 +0000 (22:04 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Mon, 23 Jan 2017 22:04:17 +0000 (22:04 +0000)
git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/mediawiki_extensions/wrreport/trunk@2585 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wrreport_body.php

index 8889b7a96345c327e2b9259b91805b54c8b927d7..845b0fdbafe5ae00b70469c5eaa37f900b3a2bcb 100644 (file)
@@ -692,13 +692,17 @@ class WrReport {
        public static function bahnberichteParserHook($input, $args, $parser) {
                $parser->getOutput()->addModules('ext.wrreport'); // getOutput() returns class ParserOutput
                $title = $parser->getTitle();
+               $page_id = $title->getArticleID();
 
-               global $wgOut; // class OutputPage
-               global $wgWrReportFeedRoot;
-               $wgOut->addFeedLink('atom', $wgWrReportFeedRoot . '/berichte/bahn/' . strtolower($title->getPartialURL()));
+               $rows = array();
+               if ($page_id > 0) {
+                       global $wgOut; // class OutputPage
+                       global $wgWrReportFeedRoot;
+                       $wgOut->addFeedLink('atom', $wgWrReportFeedRoot . '/berichte/bahn/' . strtolower($title->getPartialURL()));
 
-               $conditions = array('page_title' => $title->getText(), 'date_invalid > now()');
-               $rows = wrReportGetReports($conditions);
+                       $conditions = array('page_id' => $page_id, 'date_invalid > now()');
+                       $rows = wrReportGetReports($conditions);
+               }
                if (count($rows) == 0) return wfMessage('wrreport-reports-none')->text();
                return array(wrReportTableRender($rows, WRREPORT_COMPACT, wrReportUserMayDelete(), $parser), 'markerType' => 'nowiki');
        }