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');
}