To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit cbf0f4df authored by vermeul's avatar vermeul
Browse files

bugfixes in get_page_annotations

parent 6783c96e
...@@ -346,7 +346,10 @@ EOT; ...@@ -346,7 +346,10 @@ EOT;
// //
// Rendering of {{#annotpage}} // Rendering of {{#annotpage}}
// //
public static function annotation_page( $parser ) { public static function annotation_page( $parser, $method ) {
if (! $method == "list") {
return "";
}
$title = $parser->getTitle(); $title = $parser->getTitle();
$wikiPage = new WikiPage( $title ); $wikiPage = new WikiPage( $title );
$dbr = wfGetDB( DB_MASTER ); $dbr = wfGetDB( DB_MASTER );
...@@ -360,14 +363,14 @@ EOT; ...@@ -360,14 +363,14 @@ EOT;
EOT; EOT;
foreach($annotation as $annotations) { foreach($annotations as $annotation) {
# if a annotations has no parent, just show the annotations name # if a annotations has no parent, just show the annotations name
# in all other cases show parent_annotations:child_annotations # in all other cases show parent_annotations:child_annotations
$table .= "|-\n"; $table .= "|-\n";
$table .= "| ".$annotations->name $table .= "| ".$annotation->name
." || ".$annotations->value ." || ".$annotation->value
." || ".$annotations->insert_date ." || ".$annotation->insert_date
." || ".$annotations->user_name ." || ".$annotation->user_name
."\n"; ."\n";
} }
$table .= "|}"; $table .= "|}";
...@@ -783,10 +786,8 @@ EOT; ...@@ -783,10 +786,8 @@ EOT;
return $row; return $row;
} }
public static function get_page_annotations($dbr, $wikiPage, $order_by) { public static function get_page_annotations($dbr, $wikiPage) {
if (! $order_by) { $order_by = array('ORDER BY' => 'name');
$order_by = array('ORDER BY' => 'name');
}
$annotations = $dbr->select( $annotations = $dbr->select(
array('pa' => 'yata_page_annotation', array('pa' => 'yata_page_annotation',
...@@ -800,9 +801,7 @@ EOT; ...@@ -800,9 +801,7 @@ EOT;
'u.user_name' 'u.user_name'
), ),
array( array(
'pa.page_id' => $wikiPage->getId(), 'pa.page_id' => $wikiPage->getId()
'pa.user_id' => 'u.user_id'
), ),
__METHOD__, __METHOD__,
$order_by, $order_by,
...@@ -1273,7 +1272,7 @@ EOT; ...@@ -1273,7 +1272,7 @@ EOT;
// this is called after �Save changes� // this is called after �Save changes�
// and after onEditFilter // and after onEditFilter
public static function onArticlePrepareTextForEdit(&$wikiPage, &$popts) { public static function onArticlePrepareTextForEdit($wikiPage, $popts) {
} }
// first hook called when editing a page // first hook called when editing a page
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment