- Issue created by @joachim
- Merge request !8396Changed group property of EntityReferenceSelection attribute class to be... โ (Open) created by joachim
- Status changed to Needs review
6 months ago 9:47am 13 June 2024 - ๐ง๐ชBelgium kristiaanvandeneynde Antwerp, Belgium
Can we still reach out to whoever wrote this to hear why the whole concept of groups was introduced to begin with? I feel like another solution might be to just drop the whole idea of groups.
- ๐ฌ๐งUnited Kingdom joachim
In theory we could do that. The field settings would instead let you pick all the plugins that declare they work with the current entity type.
But in the SelectionPluginManager there's a lot of logic for selecting the 'best' plugin, so of which seems irrelevant given what EntityReferenceItem does, but which could be in use in the wild. In particular, someone could have added a default:node_extra plugin and relied in the weight to get that selected automatically in a custom form that uses the entity_autocomplete element. There'd be a lot of behaviour to first DOCUMENT (!!!!) then write tests for (there are none!! SURPRISE!!!) and then deprecate with BC. I'm not against doing that, but the MR here is a nice quick solution which means no more headdesking for devs trying to write a plugin.
- Status changed to Needs work
6 months ago 11:45am 13 June 2024 The Needs Review Queue Bot โ tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide โ to find step-by-step guides for working with issues.
- Status changed to Needs review
6 months ago 2:10pm 24 June 2024 Something not mentioned in the summary is that there can be more than one colon. The ID could be
foo:bar:baz
I'm pretty sure that when it comes to selection handlers, there can be multiple colons.
- ๐ฌ๐งUnited Kingdom joachim
True, but that won't make any difference. It's the base plugin ID that has to match the group.
- Status changed to Needs work
4 months ago 7:01pm 11 August 2024 - ๐บ๐ธUnited States smustgrave
Appears there are number of test failures.
- Status changed to Needs review
4 months ago 12:22pm 12 August 2024 - ๐ฌ๐งUnited Kingdom joachim
I was getting a different test failure local (?!!!) but I think this will fix both.
- Status changed to Needs work
4 months ago 1:27pm 4 September 2024 - ๐บ๐ธUnited States smustgrave
Still appears to be failing
Sorry took me so long to get back to this one.
- Status changed to Needs review
4 months ago 2:15pm 4 September 2024 - ๐ฌ๐งUnited Kingdom joachim
AFAICT the only failures are this deprecation:
> Setting the 'group' property on selection plugin 'default:entity_test_with_bundle is deprecated in drupal:11.1.0 and will be removed in drupal:12.0.0. The property should be removed. See
(Is there a way of finding test failures on gitlab? I'm having to scroll through endless pages of test result trying to look for them. Is this actually what we're meant to do?)
But I can't reproduce locally, e.g. modules/field/tests/src/Kernel/Entity/FieldConfigValidationTest.php --filter=testEntityReferenceSelectionHandlerIsValidated runs fine for me.
My branch is rebased, so going to push that and see what gitlab says.
- ๐ฌ๐งUnited Kingdom joachim
> But I can't reproduce locally, e.g. modules/field/tests/src/Kernel/Entity/FieldConfigValidationTest.php --filter=testEntityReferenceSelectionHandlerIsValidated runs fine for me.
My phpunit.xml needed to be updated for PHPUnit 10.5.
Fixed the test failures, I think.
- Status changed to Needs work
3 months ago 2:04pm 12 September 2024 - ๐บ๐ธUnited States smustgrave
Cleaned up IS some.
Changes look good, think ready to add a CR
- Status changed to Needs review
3 months ago 6:26pm 12 September 2024 - ๐ฎ๐ณIndia Sahana _N
Hi,
I applied the patch successfully and created the custom 'EntityReferenceSelection' plugin.
If the 'plugin_id' is "mymodule_node_type_selection:test", I did not specify any group name, so it is dynamically set to "mymodule_node_type_selection".
If the 'plugin_id' is โmymodule_node_type_selectionโ, the group name matches the 'plugin_id'.
So RTBC ++
I would greatly appreciate any suggestions or if thereโs anything I might have missed in testing.
Thank you!
- Status changed to Needs work
3 months ago 8:23pm 19 September 2024 - ๐บ๐ธUnited States smustgrave
@sahana_n adding a screenshot of your console of a patch applying is no needed, that's evident by the MR being mergable.
Left 2 small comments on the MR, but looks super close!
- ๐ฌ๐งUnited Kingdom joachim
> Could we get a simple test case for the deprecation test.
Do we really have to?
Mocking plugin discovery is really painful -- see ReflectionFactoryTest and MigrateFieldPluginManagerTest for instance. It's a LOT of test code to write just for a deprecation.
Addressed the other points.
- ๐บ๐ธUnited States smustgrave
Can see what other reviewers think. Thanks for the other points
- ๐บ๐ธUnited States smustgrave
Been a few weeks and I could wrong about the need for a deprecation test. But will see what core committers think.
- ๐ฌ๐งUnited Kingdom joachim
I filed โจ make it easier to mock plugin discovery in tests Active BTW.
- ๐บ๐ธUnited States smustgrave
So different case that deprecation test could be added to that ticket as an example. I'd be cool with that too.
The Needs Review Queue Bot โ tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide โ to find step-by-step guides for working with issues.
- First commit to issue fork.
- ๐ฎ๐ณIndia shalini_jha
I've checked the issue and identified an item related to the processDefinition method's return type. I've added the necessary type hint and am now moving this to Needs Review, Please review.