Skip to content
Snippets Groups Projects
Commit c335221a authored by project update bot's avatar project update bot Committed by Steven Ayers
Browse files

Issue #3434076 by bluegeek9, project update bot, grevil, sourav_paul, gg24:...

Issue #3434076 by bluegeek9, project update bot, grevil, sourav_paul, gg24: Automated Drupal 11 compatibility fixes for quick_node_clone
parent 8c89dc23
No related branches found
No related tags found
1 merge request!26Automated Project Update Bot fixes
Pipeline #329200 passed with warnings
web
vendor
......@@ -48,18 +48,16 @@ include:
#
# Docs at https://git.drupalcode.org/project/gitlab_templates/-/blob/1.0.x/includes/include.drupalci.variables.yml
################
# variables:
# SKIP_ESLINT: '1'
# SKIP_PHPUNIT: 1
phpcs:
allow_failure: false
phpstan:
allow_failure: false
variables:
OPT_IN_TEST_PREVIOUS_MAJOR: 1
OPT_IN_TEST_PREVIOUS_MINOR: 1
OPT_IN_TEST_NEXT_MINOR: 1
OPT_IN_TEST_NEXT_MAJOR: 1
OPT_IN_TEST_MAX_PHP: 1
# Additional testing of older group versions, the latest version is tested in the default launch.
group_integration:
extends: phpunit
extends: phpunit (previous major)
before_script:
- composer require drupal/group:$GROUP_VERSION --dev
variables:
......
name: Quick Node Clone
type: module
description: 'Quickly clone a node with regular fields.'
core_version_requirement: ^8.8 || ^9 || ^10
core_version_requirement: ^10 || ^11
configure: quick_node_clone.settingsform
dependencies:
- drupal:node
......
......@@ -3,6 +3,7 @@
namespace Drupal\quick_node_clone\Form;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Config\TypedConfigManagerInterface;
use Drupal\Core\Entity\EntityFieldManagerInterface;
use Drupal\Core\Entity\EntityTypeBundleInfoInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
......@@ -62,7 +63,8 @@ abstract class QuickNodeCloneEntitySettingsForm extends ConfigFormBase implement
$container->get('config.factory'),
$container->get('entity_field.manager'),
$container->get('entity_type.bundle.info'),
$container->get('module_handler')
$container->get('module_handler'),
$container->get('config.typed') ?? NULL
);
}
......@@ -98,9 +100,11 @@ abstract class QuickNodeCloneEntitySettingsForm extends ConfigFormBase implement
* The entity type bundle info provider.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $moduleHandler
* The module handler service.
* @param \Drupal\Core\Config\TypedConfigManagerInterface|null $typedConfigManager
* The typed config manager.
*/
public function __construct(ConfigFactoryInterface $configFactory, EntityFieldManagerInterface $entityFieldManager, EntityTypeBundleInfoInterface $entityTypeBundleInfo, ModuleHandlerInterface $moduleHandler) {
parent::__construct($configFactory);
public function __construct(ConfigFactoryInterface $configFactory, EntityFieldManagerInterface $entityFieldManager, EntityTypeBundleInfoInterface $entityTypeBundleInfo, ModuleHandlerInterface $moduleHandler, $typedConfigManager) {
parent::__construct($configFactory, $typedConfigManager);
$this->configFactory = $configFactory;
$this->entityFieldManager = $entityFieldManager;
$this->entityTypeBundleInfo = $entityTypeBundleInfo;
......@@ -148,7 +152,7 @@ abstract class QuickNodeCloneEntitySettingsForm extends ConfigFormBase implement
'#ajax' => [
'callback' => 'Drupal\quick_node_clone\Form\QuickNodeCloneEntitySettingsForm::fieldsCallback',
'wrapper' => 'fields-list-' . $this->getEntityTypeId(),
'method' => 'replace',
'method' => 'replaceWith',
],
];
......
......@@ -69,8 +69,8 @@ class QuickNodeCloneExcludeNodeFieldsTest extends BrowserTestBase {
$this->submitForm($edit, 'Save');
// Create a basic page.
$title_value = $this->randomGenerator->word(10);
$body_value = $this->randomGenerator->sentences(10);
$title_value = 'The Original Page';
$body_value = '<p>This is the original page.</p>';
$edit = [
'title[0][value]' => $title_value,
'body[0][value]' => $body_value,
......
......@@ -84,9 +84,9 @@ class QuickNodeCloneExcludeParagraphFieldsTest extends ParagraphsTestBase {
// Create a node and add two Paragraphs.
$this->drupalGet('node/add/paragraphed_test');
$title_value = $this->randomGenerator->word(10);
$text1 = $this->randomGenerator->word(10);
$text2 = $this->randomGenerator->word(10);
$title_value = 'The Original Page';
$text1 = 'This is text 1';
$text2 = 'This is text 2';
$edit = [
'title[0][value]' => $title_value,
'field_paragraphs[0][subform][field_text1][0][value]' => $text1,
......
......@@ -59,8 +59,8 @@ class QuickNodeCloneTest extends BrowserTestBase {
$this->submitForm($edit, 'Save configuration');
// Create a basic page.
$title_value = $this->randomGenerator->word(10);
$body_value = $this->randomGenerator->sentences(10);
$title_value = 'The Original Page';
$body_value = '<p>This is the original page.</p>';
$edit = [
'title[0][value]' => $title_value,
'body[0][value]' => $body_value,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment