Problem/Motivation
#3302583: Allow config actions to be addressed via a shorthand alias added the ability to use shorthand notation for config actions to reduce the noise in things that leverage the Config Actions API - see #3292285: Add the ability to define configuration actions in recipes.
I would be handy if the excellent PluginNotFoundException was augmented to include details about the shortand action IDs that are available if the config is a config entity and has shorthand actions.
Proposed resolution
Catch PluginNotFoundException and augment them somehow.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | Screenshot from 2024-08-14 18-56-14.png | 27.45 KB | akhil babu |
| #10 | Improve-PluginNotFound-exception.patch | 3.36 KB | akhil babu |
Issue fork drupal-3302833
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Issue fork distributions_recipes-3302833
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
thejimbirch commentedComment #6
akhil babuI tried to create an MR for this, but I am not able to rebase it properly
Comment #10
akhil babuThese are the changes

Comment #11
akhil babuComment #16
b_sharpe commentedComment #17
prashant.cThere are still a lot of conflicts that need rebase. Can we create a new branch and add changes to that?
Comment #18
b_sharpe commented@Prashant.c where are the conflicts? The fork is 1 commit ahead of upstream... Please provide more details.
Comment #19
prashant.c@b_sharpe
Yes, I was checking on Drupal core
11.x, now checked on the recipes project code itself and it is up-to-date, no rebase needed.The changes look good to me. Thanks
Comment #20
alexpottIt'd be great if this had test coverage. Also I think this issue can be made against drupal/core and not the recipes initiative as the code is in core.
Comment #21
akhil babuAdded the tests.
Not sure how to do it. Create a new issue against Drupal core and close this one?
Comment #22
thejimbirch commentedI am changing the issue to be against core.
I believe you will just need to open a new MR targeting core, not the recipes project.
Comment #25
akhil babuThanks @thejimbirch. I have opened a new MR against core
Comment #26
akhil babuUpdated the test to validate the config action names.
Comment #27
smustgrave commentedLeft a small comment on the MR.
Comment #28
akhil babuThanks @smustgrave. Alexpott added a comment in the MR to add a test to verify the valid config actions. Drupal\Core\Config\Action\ConfigActionManager::getShorthandActionIdsForEntityType gives the list of shorthand actions per entity type, but this method is protected. So @alexpot suggested to hardcode the exception message.
https://drupal.slack.com/archives/C1BMUQ9U6/p1724325139885199
Comment #29
oily commented@akhil babu I believe it is a question of changing the assertion itself. You can still 'hard coding' text in the (new) assertion and follow the advice of @alex pott by not using a Reflection method if you follow #27
Comment #31
oily commentedComment #33
smustgrave commentedHiding 9274
The MRs were relatively the same but 9274 was checking the current config action list at this point in time. 9411 checks the start of the exception without verifying the full list. The test was meant to just test the exception.
But believe feedback has been addressed.
The one failed test run seems unrelated https://git.drupalcode.org/issue/drupal-3302833/-/pipelines/273490
Comment #34
alexpottBackported to 10.3.x as this is helpful.
Committed e9461d7 and pushed to 11.x. Thanks!
Committed and pushed e573df5fd0 to 11.0.x and 7bf317d4c4 to 10.4.x and 5fe48edb3b to 10.3.x. Thanks!