I notice that localgov_search is installing the display modes when installed.
However it should not do this if it is being enabled on a config sync operation.
I noticed on a site I tried to install it on that when deployed I was getting memory limit errors releated to installing localgov_search. I think it's trying to enable it on all content types, which it won't need to do as this was done during the local install.
So I propose changing
function localgov_search_install() {
// Ensure the sitewide search viewmodes are set on view and index.
$node_bundles = \Drupal::service('entity_type.bundle.info')->getBundleInfo('node');
foreach ($node_bundles as $bundle => $info) {
localgov_search_entity_bundle_create('node', $bundle);
}
}
to
function localgov_search_install($is_syncing) {
if (!$is_syncing) {
// Ensure the sitewide search viewmodes are set on view and index.
$node_bundles = \Drupal::service('entity_type.bundle.info')->getBundleInfo('node');
foreach ($node_bundles as $bundle => $info) {
localgov_search_entity_bundle_create('node', $bundle);
}
}
}
I notice that localgov_search is installing the display modes when installed. However it should not do this if it is being enabled on a config sync operation. I noticed on a site I tried to install it on that when deployed I was getting memory limit errors releated to installing localgov_search. I think it's trying to enable it on all content types, which it won't need to do as this was done during the local install.
So I propose changing
to
And same for any hook_installed calls.