Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(SHS-6113): Exception on duplicate nodes being cleaned up #1770

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,7 @@ function su_humsci_profile_update_9726(&$sandbox) {
$sandbox['ids'] = array_combine($ids, $ids);
$sandbox['total'] = count($sandbox['ids']);
}
$nids = array_slice($sandbox['ids'], 0, 50);
$nids = array_slice($sandbox['ids'], 0, 100);

/** @var \Drupal\node\NodeInterface $node */
foreach ($node_storage->loadMultiple($nids) as $node) {
Expand All @@ -1340,6 +1340,11 @@ function su_humsci_profile_update_9726(&$sandbox) {
$changed = FALSE;
if ($node_settings) {
foreach ($node_settings as $node_operation => &$node_permissions) {
if (!is_array($node_permissions)) {
// Oddly enough, we can get a "per_node" operation here. That might be
// a bug with the module.
continue;
}
$clean_permissions = array_unique($node_permissions);
if ($clean_permissions !== $node_permissions) {
$changed = TRUE;
Expand Down