Hi, Iโm working on this issue as part of Drupal Global Contribution Weekend 2023 #ContributionWeekend2023
- @fjanate opened merge request.
- @fjanate opened merge request.
- ๐ฌ๐งUnited Kingdom vince.rowe
Hi there, is there any update on when the Drupal 10 updates will be complete and made usable?
Many thanks
- ๐ช๐ธSpain Carlos Romero
Carlos Romero โ made their first commit to this issueโs fork.
- ๐ง๐ชBelgium Tim Lammar
tim@lammar.be โ made their first commit to this issueโs fork.
This is an automated patch generated by Drupal Rector. Please see the issue summary for more details.
It is important that any automated tests available are run with this patch and that you manually test this patch.
Drupal 10 Compatibility
According to the Upgrade Status module โ , even with this patch, this module is not yet compatible with Drupal 10.
Currently Drupal Rector, version 0.15.1, cannot fix all Drupal 10 compatibility problems.
Therefore this patch does not update the
info.yml
file for Drupal 10 compatibility.Leaving this issue open, even after committing the current patch, will allow the Project Update Bot โ to post additional Drupal 10 compatibility fixes as they become available in Drupal Rector.
Debug info
Bot run #12554This patch was created using these packages:
- mglaman/phpstan-drupal: 1.1.35
- palantirnet/drupal-rector: 0.15.1
- ๐จ๐ณChina fishfree
This is the patch agaist the dev branch:
diff --git a/forms_steps.info.yml b/forms_steps.info.yml
index a2f9bea..64d849a 100644
--- a/forms_steps.info.yml
+++ b/forms_steps.info.yml
@@ -3,7 +3,7 @@ name: Forms Steps
description: 'Provides Drupal multiple forms steps capability using forms views.'
package: Forms
core: 8.x
-core_version_requirement: ^8 || ^9
+core_version_requirement: ^8 || ^9 || ^10
configure: entity.forms_steps.collection
dependencies:
- drupal:field
diff --git a/forms_steps.module b/forms_steps.module
index f2a29af..106117f 100644
--- a/forms_steps.module
+++ b/forms_steps.module
@@ -165,7 +165,7 @@ function forms_steps_entity_predelete($entity) {
// EntityQuery on Workflow entities.
$query = \Drupal::entityQuery(Workflow::ENTITY_TYPE);
$query->condition('entity_id', $entity_id);
- $workflow_entity_ids = $query->execute();
+ $workflow_entity_ids = $query->accessCheck()->execute();
if ($workflow_entity_ids) {
// Loop through results so we can load the result as an entity to delete.
foreach ($workflow_entity_ids as $workflow_entity_id) {
diff --git a/src/Controller/FormsStepsController.php b/src/Controller/FormsStepsController.php
index a89b9db..3b97c25 100644
--- a/src/Controller/FormsStepsController.php
+++ b/src/Controller/FormsStepsController.php
@@ -147,6 +147,7 @@ class FormsStepsController extends ControllerBase {
}
else {
$revision = $storage->getQuery()
+ ->accessCheck()
->condition($idKey, $_entity->entity_id->value)
->latestRevision()
->execute();
diff --git a/src/Event/StepChangeEvent.php b/src/Event/StepChangeEvent.php
index f686125..2ae2278 100644
--- a/src/Event/StepChangeEvent.php
+++ b/src/Event/StepChangeEvent.php
@@ -7,7 +7,7 @@ namespace Drupal\forms_steps\Event;
use Drupal\Core\Form\FormState;
use Drupal\forms_steps\Entity\FormsSteps;
use Drupal\forms_steps\Step;
-use Drupal\Component\EventDispatcher\Event;
+use Drupal\Contracts\EventDispatcher\Event;/**
* Event that is fired when before we switch from one step to another.
diff --git a/src/EventSubscriber/RouteSubscriber.php b/src/EventSubscriber/RouteSubscriber.php
index dee9683..886620e 100644
--- a/src/EventSubscriber/RouteSubscriber.php
+++ b/src/EventSubscriber/RouteSubscriber.php
@@ -102,6 +102,7 @@ class RouteSubscriber extends RouteSubscriberBase {
$entity_ids = $this->entityTypeManager
->getStorage(FormsSteps::ENTITY_TYPE)
->getQuery()
+ ->accessCheck()
->execute();// Loads of all forms steps.
diff --git a/tests/src/Functional/FormsStepsNavigationTest.php b/tests/src/Functional/FormsStepsNavigationTest.php
index d504622..e6ef25b 100644
--- a/tests/src/Functional/FormsStepsNavigationTest.php
+++ b/tests/src/Functional/FormsStepsNavigationTest.php
@@ -29,7 +29,7 @@ class FormsStepsNavigationTest extends BrowserTestBase {
*
* @var array
*/
- public static $modules = [
+ protected static $modules = [
'node',
'entity_test',
'field',
@@ -40,7 +40,7 @@ class FormsStepsNavigationTest extends BrowserTestBase {
/**
* Setup the env for current test using trait methods.
*/
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();$this->formsStepsSetup();
@@ -65,7 +65,7 @@ class FormsStepsNavigationTest extends BrowserTestBase {
->pageTextContains($this->data['forms_steps']['steps'][1]['label']);$value = 'This is an article Test Titre content';
- $this->drupalPostForm(NULL, [
+ $this->submitForm([
'title[0][value]' => $value,
], t('Save'));@@ -76,7 +76,7 @@ class FormsStepsNavigationTest extends BrowserTestBase {
$this->assertSession()->pageTextContains($value);$value2 = 'This is an article Test Titre content 2';
- $this->drupalPostForm(NULL, [
+ $this->submitForm([
'title[0][value]' => $value2,
], t('Save'));@@ -86,7 +86,7 @@ class FormsStepsNavigationTest extends BrowserTestBase {
$this->assertStringContainsStringIgnoringCase($this->data['forms_steps']['steps'][3]['url'], $this->getUrl());$value3 = 'This is a page Test Titre content';
- $this->drupalPostForm(NULL, [
+ $this->submitForm([
'title[0][value]' => $value3,
], t('Save'));@@ -99,19 +99,19 @@ class FormsStepsNavigationTest extends BrowserTestBase {
$this->assertSession()->fieldValueEquals('title[0][value]', $value2);// Access step 3.
- $this->drupalPostForm(NULL, [], 'Previous');
+ $this->submitForm([], 'Previous');
$this->assertSession()
->pageTextContains($this->data['forms_steps']['steps'][3]['label']);
$this->assertSession()->fieldValueEquals('title[0][value]', $value3);// Access step 2.
- $this->drupalPostForm(NULL, [], 'Previous');
+ $this->submitForm([], 'Previous');
$this->assertSession()
->pageTextContains($this->data['forms_steps']['steps'][2]['label']);
$this->assertSession()->fieldValueEquals('title[0][value]', $value2);// Access step 1.
- $this->drupalPostForm(NULL, [], 'Previous');
+ $this->submitForm([], 'Previous');
$this->assertSession()
->pageTextContains($this->data['forms_steps']['steps'][1]['label']);
$this->assertSession()->fieldValueEquals('title[0][value]', $value2);
diff --git a/tests/src/Functional/FormsStepsTest.php b/tests/src/Functional/FormsStepsTest.php
index 271dfef..89e4881 100644
--- a/tests/src/Functional/FormsStepsTest.php
+++ b/tests/src/Functional/FormsStepsTest.php
@@ -29,7 +29,7 @@ class FormsStepsTest extends BrowserTestBase {
*
* @var array
*/
- public static $modules = [
+ protected static $modules = [
'node',
'field',
'field_ui',
@@ -39,7 +39,7 @@ class FormsStepsTest extends BrowserTestBase {
/**
* Perform initial setup tasks that run before every test method.
*/
- public function setUp() {
+ public function setUp(): void {
parent::setUp();$this->formsStepsSetup();
@@ -65,7 +65,7 @@ class FormsStepsTest extends BrowserTestBase {
);
$this->assertSession()->statusCodeEquals(200);
// Add a form mode.
- $this->drupalPostForm(NULL, [
+ $this->submitForm([
'label' => $form_display_mode['label'],
'id' => $form_display_mode['id'],
], t('Save'));
@@ -103,7 +103,7 @@ class FormsStepsTest extends BrowserTestBase {// Activate Test Form Modes as a custom display mode.
foreach ($this->data['form_display_modes'] as $form_display_mode) {
- $this->drupalPostForm(NULL, [
+ $this->submitForm([
"display_modes_custom[${form_display_mode['id']}]" => $form_display_mode['id'],
], t('Save'));@@ -122,7 +122,7 @@ class FormsStepsTest extends BrowserTestBase {
'form_mode_name' => $form_display_mode['id'],
]));
$this->assertSession()->statusCodeEquals(200);
- $this->drupalPostForm(NULL, [
+ $this->submitForm([
'fields[title][region]' => 'content',
'fields[body][region]' => 'hidden',
'fields[status][region]' => 'hidden',
@@ -136,7 +136,7 @@ class FormsStepsTest extends BrowserTestBase {
$this->drupalGet(Url::fromRoute('entity.forms_steps.add_form'));
$this->assertSession()->statusCodeEquals(200);
// Test the creation of a form step.
- $this->drupalPostForm(NULL, [
+ $this->submitForm([
'label' => $this->data['forms_steps']['label'],
'id' => $this->data['forms_steps']['id'],
'description' => $this->data['forms_steps']['description'],
@@ -157,7 +157,7 @@ class FormsStepsTest extends BrowserTestBase {
$this->assertSession()->statusCodeEquals(200);// Test the creation of an add step.
- $this->drupalPostForm(NULL, [
+ $this->submitForm([
'label' => $step['label'],
'id' => $step['id'],
'target_form_mode' => $step['target_form_mode'],
@@ -186,7 +186,7 @@ class FormsStepsTest extends BrowserTestBase {
->pageTextContains($this->data['forms_steps']['steps'][1]['label']);$value = 'This is a Test Titre content';
- $this->drupalPostForm(NULL, [
+ $this->submitForm([
'title[0][value]' => $value,
], t('Save'));diff --git a/tests/src/Kernel/KernelTestBase.php b/tests/src/Kernel/KernelTestBase.php
index 8237219..addb062 100644
--- a/tests/src/Kernel/KernelTestBase.php
+++ b/tests/src/Kernel/KernelTestBase.php
@@ -16,7 +16,7 @@ abstract class KernelTestBase {
*
* @var array
*/
- public static $modules = ['forms_steps', 'user'];
+ protected static $modules = ['forms_steps', 'user'];/**
* Setup the env for current test using trait methods.
diff --git a/tests/src/Traits/FormsStepsTestTrait.php b/tests/src/Traits/FormsStepsTestTrait.php
index 037adc9..0761151 100644
--- a/tests/src/Traits/FormsStepsTestTrait.php
+++ b/tests/src/Traits/FormsStepsTestTrait.php
@@ -123,14 +123,10 @@ trait FormsStepsTestTrait {
);// Add a form mode.
- $this->drupalPostForm(
- NULL,
- [
- 'label' => $form_display_mode['label'],
- 'id' => $form_display_mode['id'],
- ],
- t('Save')
- );
+ $this->submitForm([
+ 'label' => $form_display_mode['label'],
+ 'id' => $form_display_mode['id'],
+ ], t('Save'));Role::load($this->user->getRoles()[1])
->grantPermission('use node.' . $form_display_mode['id'] . ' form mode')
@@ -162,13 +158,9 @@ trait FormsStepsTestTrait {// Activate Test Form Modes as a custom display mode.
foreach ($this->data['form_display_modes'] as $form_display_mode) {
- $this->drupalPostForm(
- NULL,
- [
- "display_modes_custom[${form_display_mode['id']}]" => $form_display_mode['id'],
- ],
- t('Save')
- );
+ $this->submitForm([
+ "display_modes_custom[${form_display_mode['id']}]" => $form_display_mode['id'],
+ ], t('Save'));
}// Configure the visible fields.
@@ -182,33 +174,25 @@ trait FormsStepsTestTrait {
)
);- $this->drupalPostForm(
- NULL,
- [
- 'fields[title][region]' => 'content',
- 'fields[body][region]' => 'hidden',
- 'fields[status][region]' => 'hidden',
- 'fields[uid][region]' => 'hidden',
- 'fields[created][region]' => 'hidden',
- 'fields[promote][region]' => 'hidden',
- 'fields[sticky][region]' => 'hidden',
- ],
- t('Save')
- );
+ $this->submitForm([
+ 'fields[title][region]' => 'content',
+ 'fields[body][region]' => 'hidden',
+ 'fields[status][region]' => 'hidden',
+ 'fields[uid][region]' => 'hidden',
+ 'fields[created][region]' => 'hidden',
+ 'fields[promote][region]' => 'hidden',
+ 'fields[sticky][region]' => 'hidden',
+ ], t('Save'));// Access forms steps add page.
$this->drupalGet(Url::fromRoute('entity.forms_steps.add_form'));// Test the creation of a form step.
- $this->drupalPostForm(
- NULL,
- [
- 'label' => $this->data['forms_steps']['label'],
- 'id' => $this->data['forms_steps']['id'],
- 'description' => $this->data['forms_steps']['description'],
- ],
- t('Save')
- );
+ $this->submitForm([
+ 'label' => $this->data['forms_steps']['label'],
+ 'id' => $this->data['forms_steps']['id'],
+ 'description' => $this->data['forms_steps']['description'],
+ ], t('Save'));// Perform steps creation.
foreach ($this->data['forms_steps']['steps'] as $step) {
@@ -223,35 +207,28 @@ trait FormsStepsTestTrait {
);// Test the creation of an add step.
- $this->drupalPostForm(
- NULL,
- [
- 'label' => $step['label'],
- 'id' => $step['id'],
- 'target_form_mode' => $step['target_form_mode'],
- 'target_entity_bundle' => $step['target_entity_bundle'],
- 'target_entity_type' => $step['target_entity_type'],
- 'url' => $step['url'],
- ],
- t('Save')
- );
+ $this->submitForm([
+ 'label' => $step['label'],
+ 'id' => $step['id'],
+ 'target_form_mode' => $step['target_form_mode'],
+ 'target_entity_bundle' => $step['target_entity_bundle'],
+ 'target_entity_type' => $step['target_entity_type'],
+ 'url' => $step['url'],
+ ], t('Save'));if (!is_null($step['previous'])) {
- // Update step with previous label.
- $this->drupalPostForm(
- Url::fromRoute(
- 'entity.forms_steps.edit_step_form',
- [
- 'forms_steps' => $this->data['forms_steps']['id'],
- 'forms_steps_step' => $step['id'],
- ]
- ),
+ $this->drupalGet(Url::fromRoute(
+ 'entity.forms_steps.edit_step_form',
[
- 'display_previous' => TRUE,
- 'previous_label' => $step['previous'],
- ],
- t('Save')
- );
+ 'forms_steps' => $this->data['forms_steps']['id'],
+ 'forms_steps_step' => $step['id'],
+ ]
+ ));
+ // Update step with previous label.
+ $this->submitForm([
+ 'display_previous' => TRUE,
+ 'previous_label' => $step['previous'],
+ ], t('Save'));
}
}
} - First commit to issue fork.
- last update
about 1 year ago Composer require failure - ๐ฎ๐ณIndia sumithra ramalingam
Hi, I was using this module with D9.5 and now have asked for D10 upgradation. Someone could please help me on upgrading this module with D10 compatible.
- ๐ซ๐ทFrance nicoloye
I'll review this issue current work status, but I won't be able to do so before DrupalCon.
If anybody wants to step up before that feel free to do so. - ๐บ๐ธUnited States oadaeh
I was working on this last week, but had to rebuild my local environment, due to various problems, so that delayed me a bit.
Due to the fact that the MR is broken, I chose to manually create a patch file with all the relevant parts (and hopefully leaving out the brokenness). I did not at all investigate comment #17.
The patch does apply for me, but only to 8.x-1.x-dev, due to some incompatible changes between it and 8.x-1.5. - ๐ฌ๐งUnited Kingdom Alina Basarabeanu
The patch from #5 works as expected on forms_steps 8.x-1.x-dev and Drupal Version 9.5.11.
- ๐บ๐ฆUkraine artem_sylchuk Lutsk
Patch from #21 applies clearly, however it includes the irrelevant part with automatted converting the ->link() to ->toLink()->toString() by rector.
Fixed that and attached the interdiff.I tried to fix the MR, but it includes a lot of uneeded changes in commits history and it doesn't seem I can create a new branch for some reason.
So I hope patch is fine too. - ๐บ๐ธUnited States oadaeh
Thanks for that @artem_sylchuk.
There are two more in src/Form/FormsStepsEditForm.php and one in src/Form/FormsStepsProgressStepEditForm.php.
- ๐บ๐ฆUkraine artem_sylchuk Lutsk
Oh, my bad.
Thanks for pointing that out @oadaeh!
Updated the patch. - ๐ฉ๐ชGermany spuky
Upgrade Status is finding no Issues after applying the patch...
- ๐บ๐ธUnited States brooke_heaton
I can confirm that patch #25 applies clean and upgrade_status no longer triggers an issue.
- ๐บ๐ธUnited States chucksimply
Confirming #25 works on 8.x-1.x-dev and Drupal Version 9.5.11. Can we commit to dev, and get a new official release?
- Status changed to RTBC
about 1 year ago 5:40pm 6 November 2023 - ๐ฉ๐ชGermany spuky
For any body using the patch here for their upgrade to D10 there is another issue patch you need to install
- ๐ฉ๐ชGermany spuky
For anybody using this patch for D10 upgrade you also need https://www.drupal.org/project/forms_steps/issues/3287673 ๐ Automated Drupal 10 compatibility fixes RTBC
-
artem_sylchuk โ
authored d64e830c on 8.x-1.x
Issue #3287673 by ibullock, Project Update Bot, fjanate, tim@lammar.be,...
-
artem_sylchuk โ
authored d64e830c on 8.x-1.x
- Status changed to Fixed
12 months ago 9:19pm 23 November 2023 - ๐ซ๐ทFrance nicoloye
Patch committed to the dev branch, preparing a new D10 release.
Thanks everybody for the great work! Automatically closed - issue fixed for 2 weeks with no activity.