In doing some custom work on a site, I found a line the core code that doesn’t make sense in core/model/modx/sources/modmediasource.class.php. The line is “$context = ‘mgr’;”, as shown in context below:
public function findPolicy($context = '') {
$policy = array();
$enabled = true;
$context = 'mgr';
if ($context === $this->xpdo->context->get('key')) {
$enabled = (boolean) $this->xpdo->getOption('access_media_source_enabled', null, true);
The line renders the $context parameter useless and forces the value to be ‘mgr’ instead.
On the site I am working on, it generates a lot of messages about the ‘mgr’ context when I am trying to access pages of the ‘web’ context.
I have removed the line from our code and don’t see anything negatively impacted. Does anyone know why this parameter is being forced to the ‘mgr’ context in all cases or see anything wrong with removing this line?