- Issue created by @srishtiiee
- Status changed to Needs review
about 1 year ago 6:55am 15 December 2023 - ๐ฎ๐ณIndia arisen Goa
Thanks for the feature suggestion @srishtiiee.
Review the Merge Request. The changes look good and working a expected.
Tested the same on a Drupal 11 installation.
Testing steps:- Setup a Drupal 11 site and applied the patch from the MR
- Created a Custom Ajax form with a button and a custom submit handler.
- Inside the handler added the code snippet to open a node in a dialog.
$response = new AjaxResponse(); $url = Url::fromRoute('entity.node.canonical', ['node' => 1]); $command = new OpenModalDialogWithUrl($url->toString(), [ 'url' => 'example', 'width' => 500, 'title' => 'Title', 'modal' => TRUE, ]); $response->addCommand($command); return $response;
- The node gets displayed in a dialog as expected.
Attaching the screenshots.
This looks RTBC for me.
- ๐บ๐ธUnited States smustgrave
Feels like something that will need a CR
- Status changed to Needs work
about 1 year ago 1:27pm 15 December 2023 - ๐บ๐ธUnited States benjifisher Boston area
I am adding โจ Multistep Form Wizard Needs work as a related issue. I have not looked at it closely, but I think that is more specialized than this issue, trying to make it easier to create multi-step entity forms.
- ๐ฎ๐ณIndia kunal.sachdev
kunal.sachdev โ made their first commit to this issueโs fork.
- Status changed to Needs review
about 1 year ago 7:51am 19 December 2023 - Status changed to RTBC
about 1 year ago 2:55pm 19 December 2023 - ๐บ๐ธUnited States smustgrave
1) Drupal\Tests\Core\Ajax\AjaxCommandsTest::testOpenModalDialogWithUrl Error: Class "Drupal\Core\Ajax\OpenModalDialogWithUrl" not found /builds/issue/drupal-3408738/core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php:509 /builds/issue/drupal-3408738/vendor/phpunit/phpunit/src/Framework/TestResult.php:728 /builds/issue/drupal-3408738/vendor/phpunit/phpunit/src/Framework/TestSuite.php:684 /builds/issue/drupal-3408738/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:651 /builds/issue/drupal-3408738/vendor/phpunit/phpunit/src/TextUI/Command.php:144 /builds/issue/drupal-3408738/vendor/phpunit/phpunit/src/TextUI/Command.php:97 ERRORS! Tests: 32, Assertions: 37, Errors: 1.
CR reads well.
Applied the MR and used the snippet in the CR to open a dialog. I used a node add form, as that's something I'm currently working on in my project.
Reviewing the code and believe this is good
- ๐บ๐ธUnited States tim.plunkett Philadelphia
+1 to RTBC, the Drupal.ajax vs ajax discussion in the MR can be resolved
- Status changed to Needs work
about 1 year ago 8:23am 22 December 2023 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
There are a bunch of small inconsistencies in the code. Some parameters/decisions should be documented. And most importantly: neither this MR nor the CR document how this relates to the multiple existing dialog-related AJAX commands. "When to use which?" is a critical portion of landing this.
- First commit to issue fork.
- Status changed to Needs review
12 months ago 4:45am 3 January 2024 - ๐ฎ๐ณIndia arisen Goa
And most importantly: neither this MR nor the CR document how this relates to the multiple existing dialog-related AJAX commands. "When to use which?" is a critical portion of landing this.
Updated the CR to address this.
- Status changed to RTBC
12 months ago 4:22pm 3 January 2024 - ๐บ๐ธUnited States smustgrave
CR appears to have been updated with a usage.
Not sure where documentation should go though. Assuming here https://www.drupal.org/docs/drupal-apis/ajax-api/core-ajax-callback-comm... โ but imagine the update should be after the code is committed right?
- Status changed to Needs work
12 months ago 8:19am 4 January 2024 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
This is still missing crucial documentation, so it can't be RTBC.
Plus, based on the test coverage I just realized that this appears to be introducing a new potential attack surface ๐ฐ So tagging as wellโฆ
- ๐ฎ๐ณIndia omkar.podey
omkar.podey โ made their first commit to this issueโs fork.
- Status changed to Needs review
11 months ago 12:20pm 6 February 2024 - Status changed to Needs work
10 months ago 9:21am 14 February 2024 - Status changed to Needs review
10 months ago 9:27am 21 February 2024 - Status changed to Needs work
10 months ago 5:14am 26 February 2024 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Detailed my security concerns at https://git.drupalcode.org/project/drupal/-/merge_requests/5810#note_272697.
- Status changed to Needs review
10 months ago 10:56am 28 February 2024 - ๐ฌ๐งUnited Kingdom catch
The hardening and test coverage looks good to me.
- ๐บ๐ธUnited States smustgrave
Have posted to #security-discussion in slack so fingers crossed someone can pick up.
- Status changed to RTBC
10 months ago 10:48am 5 March 2024 - ๐ซ๐ฎFinland lauriii Finland
The aspect that required security review has been addressed. I think a regular committer review is sufficient now.
- Status changed to Needs work
10 months ago 10:54am 5 March 2024 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Yes, agreed, the security concerns I raised are now addressed ๐
Just a few remarks to ensure A) docs are discoverable by developers, B) this stays aligned/in sync with the other place in core where this pattern is used.
- Status changed to Needs review
10 months ago 9:34am 7 March 2024 - Status changed to RTBC
10 months ago 9:36am 7 March 2024 - ๐ซ๐ฎFinland lauriii Finland
Feedback from @Wim Leers has been addressed ๐
- Status changed to Fixed
10 months ago 10:30am 7 March 2024 - ๐ฌ๐งUnited Kingdom catch
One more thought - we could add an extra method on UrlHelper for the local check, combining those two method calls. I was thinking about a trait, but why not just an extra helper method directly on that class.
Not for here though, so committed/pushed to 11.x and cherry-picked to 10.3.x, thanks!
Automatically closed - issue fixed for 2 weeks with no activity.
- ๐ณ๐ฟNew Zealand quietone
Follow up added ๐ Add an extra method on UrlHelper for a local check Active