The discovery of the plugin handlers doesn't seem to work properly. I wanted to get at all conditional_field plugin handlers in use, but I only get back the 4 plugin handlers which are added through StaticDiscovery.
Source code showing the problem is attached:
- Put the attached ConditionalFieldsMissingDefinitions.txt file in the src directory of conditional_fields and change the extension from txt to php. It doesn't have real functionality, it's just showing the problem.
- In ConditionalFieldsFormHelper.php change the start of function getState() to look like this:
protected static function getState(EntityFormDisplayInterface $form_display, $dependee, $dependee_form_field, $options, $form_state = NULL) {
$plugin_cache = ConditionalFieldsMissingDefinitions::getInstance();
- Add content in Drupal using a form that uses ConditionalFields.
- Look at the "Recent Log Messages" in Drupal showing the output. In the output you will see only 4 entries, while I would have expected at least all of the handlers in the "conditional_fields\src\Plugin\conditional_fields\handler" directory to be present.
I'm using Drupal 8.8.2
| Comment | File | Size | Author |
|---|---|---|---|
| ConditionalFieldsMissingDefinitions.txt | 692 bytes | sboden | |
| result_log_message.txt | 2.77 KB | sboden |
Comments
Comment #2
sboden commentedI did some more checking.
- The current dev version (on 22 feb 2020) does not have the behaviour described in the issue, in the dev version all plugins are present in the getDefinitions() output.
However there I see other problems:
- The LinkAddressfield plugin which is under extra_contrib, is using the wrong namespace: it's using the namespace of one 'directory' higher. This is problematic if you want to instantiate plugins based on discovery.
- In the getDefinitions() output the first 4 entries have different fields than the following plugins in the output. The first 4 plugins are the ones also outputted in the class attached to this issue, these don't have a key 'id' in their array. The other plugins in the getDefinitions() output do have a key 'id' in their array.
Comment #3
colanFrom #3086250-8: This module makes form super slow:
So is this still an issue? It's not clear to me if this was already fixed or not.
Comment #4
baikho commented