diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..b41ae3fc0eb43752a68552bd6190e606d13b9a21 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +web +vendor diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index edb32a3c110b5bd9aceaa31411554e1e59e258a0..449e6bd0862b728b7f5f67053764333846f57246 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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: diff --git a/quick_node_clone.info.yml b/quick_node_clone.info.yml index 856eb5195d15f1c6eb19bcdfb85f67fe55229c7f..05fc4dc29245dd8cd1bdea954eb7edb2dc793bc9 100644 --- a/quick_node_clone.info.yml +++ b/quick_node_clone.info.yml @@ -1,7 +1,7 @@ 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 diff --git a/src/Form/QuickNodeCloneEntitySettingsForm.php b/src/Form/QuickNodeCloneEntitySettingsForm.php index 6b18a482efa0fd9d85aa566c31c67cad98ced9ba..8344f83269690d4b497569cfa3714f005695650d 100644 --- a/src/Form/QuickNodeCloneEntitySettingsForm.php +++ b/src/Form/QuickNodeCloneEntitySettingsForm.php @@ -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', ], ]; diff --git a/tests/src/Functional/QuickNodeCloneExcludeNodeFieldsTest.php b/tests/src/Functional/QuickNodeCloneExcludeNodeFieldsTest.php index 39bafafd57e5f5b816e4d73e8ee138ded00e6f43..4480356d700de6c4343bbd5466a1da03063fc79b 100644 --- a/tests/src/Functional/QuickNodeCloneExcludeNodeFieldsTest.php +++ b/tests/src/Functional/QuickNodeCloneExcludeNodeFieldsTest.php @@ -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, diff --git a/tests/src/Functional/QuickNodeCloneExcludeParagraphFieldsTest.php b/tests/src/Functional/QuickNodeCloneExcludeParagraphFieldsTest.php index bc60f13d5cb8a3ce4afd2a7b45b1fec3ff004156..cbda38bd34e779acf34effef261f2d54844fff79 100644 --- a/tests/src/Functional/QuickNodeCloneExcludeParagraphFieldsTest.php +++ b/tests/src/Functional/QuickNodeCloneExcludeParagraphFieldsTest.php @@ -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, diff --git a/tests/src/Functional/QuickNodeCloneTest.php b/tests/src/Functional/QuickNodeCloneTest.php index 8ebae0d0cb8d121e8a0069c9e8b8d4a646caf42b..f18cb6673b00cba9f0d4d5365c441ad65e50a5fa 100644 --- a/tests/src/Functional/QuickNodeCloneTest.php +++ b/tests/src/Functional/QuickNodeCloneTest.php @@ -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,