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
As the title says this hook doesn't have a corresponding update from what I can see for existing installs:
/**
* Implements hook_modules_installed().
*/
function localgov_workflows_modules_installed($modules, $is_syncing) {
// Fix the core moderated content view.
if (in_array('localgov_workflows', $modules, TRUE) && !$is_syncing) {
// Don't change things if the core editorial workflow is enabled.
if (!is_null(\Drupal::entityTypeManager()->getStorage('workflow')->load('editorial'))) {
return;
}
$moderated_content_view = \Drupal::entityTypeManager()
->getStorage('view')
->load('moderated_content');
if ($moderated_content_view) {
// Fix filters to match editorial workflow.
$display = $moderated_content_view->get('display');
$filters = $display['default']['display_options']['filters'];
$filters['moderation_state']['value'] = [
'localgov_editorial-draft' => 'localgov_editorial-draft',
'localgov_editorial-review' => 'localgov_editorial-review',
'localgov_editorial-archived' => 'localgov_editorial-archived',
];
$filters['moderation_state_1']['value'] = [
'localgov_editorial-published' => 'localgov_editorial-published',
];
$display['default']['display_options']['filters'] = $filters;
// Update no results text.
$display['default']['display_options']['empty']['area_text_custom']['content'] = 'No unpublished content available. Pages in Draft, Review and Archived states appear here.';
$moderated_content_view->set('display', $display);
$moderated_content_view->save();
}
}
}
Noticed this when we had published content appearing in the 'Unpublished' report. We've already resolved this for ourselves by running the hook code and exporting the new view config, seems to have stopped the incorrect results coming through.
The text was updated successfully, but these errors were encountered:
As the title says this hook doesn't have a corresponding update from what I can see for existing installs:
Noticed this when we had published content appearing in the 'Unpublished' report. We've already resolved this for ourselves by running the hook code and exporting the new view config, seems to have stopped the incorrect results coming through.
The text was updated successfully, but these errors were encountered: