diff --git a/composer.json b/composer.json index 650340a3850ec5a63f37fefbf05c8baa6df98003..71b6bceda3206d600e7fa1b903b5977c3967da97 100644 --- a/composer.json +++ b/composer.json @@ -292,6 +292,9 @@ "Fixes TypeError on FileUrlGenerator::generateString for >= 9.3.x https://www.drupal.org/project/drupal/issues/3254245": "patches/3254245-78.patch", "Workaround for Call to a member function getLabel() after enabling layout_builder for 10.1.x: PHP 8.1 https://www.drupal.org/project/drupal/issues/2985882#comment-14787690": "patches/2985882-field-153.patch" }, + "drupal/content_access": { + "Fixes deprecated unserialize() function https://www.drupal.org/project/content_access/issues/3258804": "pathces/content_access-3258804-14.patch" + }, "drupal/paragraphs": { "DRUPAL-466: adds the widget that fixes the landing pages issues\n WARNING: there is a new version of this patch upstream for PHP7.2 with some community validation. But since this version still applies cleanly, we wont update it yet.": "patches/experimental-widget-asymetric-translation-2904705-47.patch" }, diff --git a/patches/content_access-3258804-14.patch b/patches/content_access-3258804-14.patch new file mode 100644 index 0000000000000000000000000000000000000000..8d8ab5f7718dd5cc14456600bbb55c0f49454be9 --- /dev/null +++ b/patches/content_access-3258804-14.patch @@ -0,0 +1,72 @@ +diff --git a/src/Plugin/RulesAction/ActionCommonTrait.php b/src/Plugin/RulesAction/ActionCommonTrait.php +--- a/src/Plugin/RulesAction/ActionCommonTrait.php ++++ b/src/Plugin/RulesAction/ActionCommonTrait.php +@@ -14,13 +14,13 @@ trait ActionCommonTrait { + * Verifies that per content settings are activated for the given node. + */ + protected function checkSetting(NodeInterface $node) { + $config = \Drupal::configFactory()->getEditable('content_access.settings'); + + $type = $node->getType(); +- $settings = unserialize($config->get('content_access_node_type.' . $type)); ++ $settings = unserialize((string) $config->get('content_access_node_type.' . $type)); + + if (isset($settings['per_node']) && $settings['per_node']) { + return TRUE; + } + + // If we didn't find any settings in content access for this type return + + +diff --git a/src/Form/ContentAccessPageForm.php b/src/Form/ContentAccessPageForm.php +--- a/src/Form/ContentAccessPageForm.php ++++ b/src/Form/ContentAccessPageForm.php +@@ -121,13 +121,13 @@ + $update = (int) ($op == 'update'); + acl_node_add_acl($node->id(), $acl_id, $view, $update, (int) ($op == 'delete'), content_access_get_settings('priority', $node->getType())); + + $form['acl'][$op] = acl_edit_form($form_state, $acl_id, $this->t('Grant @op access', ['@op' => $op])); + + $post_acl_id = $this->getRequest()->request->get('acl_' . $acl_id, NULL); +- $form['acl'][$op]['#collapsed'] = !isset($post_acl_id) && !unserialize($form['acl'][$op]['user_list']['#default_value']); ++ $form['acl'][$op]['#collapsed'] = !isset($post_acl_id) && !unserialize((string) $form['acl'][$op]['user_list']['#default_value']); + } + } + + $storage['node'] = $node; + $form_state->setStorage($storage); + + +diff --git a/content_access.module b/content_access.module +--- a/content_access.module ++++ b/content_access.module +@@ -219,13 +219,13 @@ + * + * @return mixed + * The value of the given setting or an array of all settings. + */ + function content_access_get_settings($setting, $type_name) { + $config = \Drupal::configFactory()->getEditable('content_access.settings'); +- $settings = unserialize($config->get('content_access_node_type.' . $type_name)); ++ $settings = unserialize((string) $config->get('content_access_node_type.' . $type_name)); + if (empty($settings)) { + $settings = []; + } + $settings += content_access_get_setting_defaults($type_name); + + if ($setting == 'all') { +@@ -499,13 +499,13 @@ + $query = \Drupal::database()->query("SELECT settings FROM {content_access} WHERE nid = :nid", [ + ':nid' => $node->id(), + ]); + $result = $query->fetch(PDO::FETCH_OBJ); + + if (!empty($result->settings)) { +- return unserialize($result->settings); ++ return unserialize((string) $result->settings); + } + + return []; + } + + /**