- First commit to issue fork.
- πΊπΈUnited States mortona2k Seattle
I think it needs to be a string. When entityTypeAlter() is called, it uses array_filter() on the active_on array, which returns an array of the values. So that needs to be the entity type, not a boolean.
Also, the settings form wasn't saving correctly because it didn't account for the active_on key. I fixed this in the last commit, so it is now:
foreach ($form_state->getValues()['active_on'] as $key => $data) { if (!in_array($key, $exclude)) { $config->set("active_on.$key", $data); }
The config needs to match the format used to build the checkboxes:
$active_on_default_value = $config->get('active_on') ?? (in_array('node', array_keys($entity_types)) ? ['node' => 'node'] : []); ... '#options' => array_combine(array_keys($entity_types), array_keys($entity_types)), '#default_value' => $active_on_default_value,
Config gets stored as:
active_on: node: node block_content: '0' code_sample: '0' comment: '0' contact_message: '0' file: '0' media: media menu_link_content: '0' path_alias: '0' shortcut: '0' taxonomy_term: '0' user: '0' paragraph: '0'
I think it would make more sense to just store the entity type for active entities, and not include user: '0'. That would look like:
active_on: - node - block_content
This is how it's done in the book module, the schema and settings form are good references.
-
matthieuscarset β
committed bcf05bbc on 1.0.x
feat(settings): Prettier settings (#3320255)
-
matthieuscarset β
committed bcf05bbc on 1.0.x
Thank you very much once again for your contributions.
I agree the setting values are not ideally formatted.
I have updated
entity_usage_light.settings
and{entity_type}.{bundle}.third_party.entity_usage_light.entity_type_ids
value lists in this commit.The config inspector does not return errors anymore.
Keeping this issue as Needs Review because we need to confirm the
hook_update_891001()
works correctly and that we are happy with the schema and configurations.- Status changed to Needs work
9 months ago 9:40pm 4 April 2024 - πΊπΈUnited States smustgrave
Probably could look into some validation now that that has taken off.
-
smustgrave β
committed bfe3b206 on 1.0.x
Issue #3320255 by smustgrave, mortona2k: Missing schema
-
smustgrave β
committed bfe3b206 on 1.0.x
- Status changed to Fixed
9 months ago 4:58pm 10 April 2024 - πΊπΈUnited States smustgrave
Marked the sequence as validatable so all schema is good :)
Automatically closed - issue fixed for 2 weeks with no activity.