You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After installation of dokuwiki-plugin-approve, I notice that accessing any uploaded media files cause an error when you attempt to view their 'history' tab in media manager, with this error being triggered by approve/helper/acl.php:
This references the following function in acl.php:
public function useApproveHere($id) {
/** @var helper_plugin_approve_db $db */
$db = $this->loadHelper('approve_db');
$page_metadata = $db->getPageMetadata($id);
if ($page_metadata === null) { // do not use approve plugin here
return false;
}
return true;
}
I'm not sure why this doesn't work out-of-the-box for media-manager, but it would seem the following change fixes the behaviour:
public function useApproveHere($id) {
/** @var helper_plugin_approve_db $db */
if ($id === null) { // do not use approve plugin here
return false;
}
$db = $this->loadHelper('approve_db');
$page_metadata = $db->getPageMetadata($id);
if ($page_metadata === null) { // do not use approve plugin here
return false;
}
return true;
}
i.e. do not attempt to follow the approve plugin workflow if the $id of the object is null.
I'm not a PHP developer, or overly familiar with the internals of Dokuwiki, so I would appreciate it if anyone could identify whether this is a proper fix, or if it will break some other functionality.
This is on Dokuwiki 2024-02-06b, with dokuwiki-approve-plugin head from 25/11/2024.
The text was updated successfully, but these errors were encountered:
After installation of dokuwiki-plugin-approve, I notice that accessing any uploaded media files cause an error when you attempt to view their 'history' tab in media manager, with this error being triggered by approve/helper/acl.php:
This references the following function in acl.php:
I'm not sure why this doesn't work out-of-the-box for media-manager, but it would seem the following change fixes the behaviour:
i.e. do not attempt to follow the approve plugin workflow if the $id of the object is null.
I'm not a PHP developer, or overly familiar with the internals of Dokuwiki, so I would appreciate it if anyone could identify whether this is a proper fix, or if it will break some other functionality.
This is on Dokuwiki 2024-02-06b, with dokuwiki-approve-plugin head from 25/11/2024.
The text was updated successfully, but these errors were encountered: