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
The hooks _post_update_NAME in oe_editorial_corporate_workflow load a role "oe_translator" and call to a method without checking if the role exists.
If the oe_translation module is not enabled, the role e_translator don't exist and the hook throws an error.
The oe_translation module is not a dependency of oe_editorial module.
Error
Error: Call to a member function set() on null in oe_editorial_corporate_workflow_post_update_00001()
(line 29 of .../web/modules/contrib/oe_editorial/modules/oe_editorial_corporate_workflow/oe_editorial_corporate_workflow.post_update.php).
Suggested soluction
Change dependencies or check the role object
// Current code
function oe_editorial_corporate_workflow_post_update_00001(): void {
\Drupal::entityTypeManager()
->getStorage('user_role')
->load('oe_translator')
->set('label', 'Translate content')
->save();
// New code
function oe_editorial_corporate_workflow_post_update_00001(): void {
$role = \Drupal::entityTypeManager()
->getStorage('user_role')
->load('oe_translator');
if ($role) {
$role
->set('label', 'Translate content')
->save();
}
}
The text was updated successfully, but these errors were encountered:
Description
The hooks _post_update_NAME in oe_editorial_corporate_workflow load a role "oe_translator" and call to a method without checking if the role exists.
If the oe_translation module is not enabled, the role e_translator don't exist and the hook throws an error.
The oe_translation module is not a dependency of oe_editorial module.
Error
Error: Call to a member function set() on null in oe_editorial_corporate_workflow_post_update_00001()
(line 29 of .../web/modules/contrib/oe_editorial/modules/oe_editorial_corporate_workflow/oe_editorial_corporate_workflow.post_update.php).
Suggested soluction
Change dependencies or check the role object
The text was updated successfully, but these errors were encountered: