Commit 9c54d4b4 authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic Committed by Robert Lyon
Browse files

Bug 1791544: MENUINTEM not defined in artefact page

MENUITEM needs to be defined in artefact/artefact.php
way to access this page:
in a page owned by other user, click on an artefact
they have shared in it

Also need to check if MENUITEM is defined before trying to access it
as some pages don't need a MENUITEM set, eg artefact/file/download.php

behatnotneeded

Change-Id: Idb8479393034fe42dce8d88ed7f23c72fa20c337
parent 626188ac
......@@ -11,6 +11,7 @@
define('INTERNAL', 1);
define('PUBLIC', 1);
define('MENUITEM', 'create/files');
define('SECTION_PLUGINTYPE', 'core');
define('SECTION_PLUGINNAME', 'core');
define('SECTION_PAGE', 'artefact');
......
......@@ -4047,10 +4047,13 @@ function tags_sideblock() {
'data' => $tags,
'template' => 'sideblocks/tags.tpl',
'visible' => $USER->is_logged_in() &&
in_array(MENUITEM, array('profile',
'create/files',
'share/sharedbyme',
'create/views')),
(defined('MENUITEM') &&
in_array(MENUITEM, array('profile',
'create/files',
'share/sharedbyme',
'create/views')
)
),
);
return $sideblock;
}
......
......@@ -1450,7 +1450,7 @@ function sideblock_template($sideblock, &$sideblock_menu) {
'visible' => false, // Controls whether the sideblock is visible.
// Examples:
// to display when logged in: 'visible' => $USER->is_logged_in(),
// to display for certain pages: 'visible' => in_array(MENUITEM, array('myportfolio/view')),
// to display for certain pages: 'visible' => (defined('MENUITEM') && in_array(MENUITEM, array('myportfolio/view'))),
);
$sideblock = array_merge($defaultsideblock, $sideblock);
$sideblock_menu[$sideblock['name']] = $sideblock;
......@@ -3347,10 +3347,13 @@ function selfsearch_sideblock() {
'data' => array(),
'template' => 'sideblocks/selfsearch.tpl',
'visible' => $USER->is_logged_in() &&
in_array(MENUITEM, array('profile',
'create/files',
'share/sharedbyme',
'create/views')),
(defined('MENUITEM') &&
in_array(MENUITEM, array('profile',
'create/files',
'share/sharedbyme',
'create/views')
)
),
);
return $sideblock;
}
......
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