Needs work
Project:
Drupal core
Version:
main
Component:
workflows.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
2 Nov 2017 at 10:16 UTC
Updated:
21 Feb 2024 at 17:34 UTC
Jump to comment: Most recent
Workflow config entities are partially validatable using the typed config system, but not quite. There are several properties that are not yet validatable:
$ ./vendor/bin/drush config:inspect --filter-keys=workflows.workflow.editorial --detail --list-constraints --fields=key,validatability,constraints
➜ 🤖 Analyzing…
------------------------------------------ ------------- ---------------------------------------------------------------------------------
Key Validatable Validation constraints
------------------------------------------ ------------- ---------------------------------------------------------------------------------
workflows.workflow.editorial 53% ValidKeys: '<infer>'
workflows.workflow.editorial: Validatable ValidKeys: '<infer>'
workflows.workflow.editorial:_core Validatable ValidKeys:
- default_config_hash
workflows.workflow.editorial:_core.defa Validatable NotNull: { }
ult_config_hash Regex: '/^[a-zA-Z0-9\-_]+$/'
Length: 43
↣ PrimitiveType: { }
workflows.workflow.editorial:dependenci Validatable ValidKeys: '<infer>'
es
workflows.workflow.editorial:dependenci NOT ❌ @todo Add validation constraints to ancestor type: config_dependencies
es.module
workflows.workflow.editorial:dependenci Validatable NotBlank: { }
es.module.0 ExtensionName: { }
ExtensionExists: module
↣ PrimitiveType: { }
workflows.workflow.editorial:id Validatable Regex:
pattern: '/^[a-z0-9_]+$/'
message: 'The %value machine name is not valid.'
Length:
max: 166
↣ PrimitiveType: { }
workflows.workflow.editorial:label Validatable Regex:
pattern: '/([^\PC])/u'
match: false
message: 'Labels are not allowed to span multiple lines or contain control
characters.'
NotBlank: { }
↣ PrimitiveType: { }
workflows.workflow.editorial:langcode Validatable NotNull: { }
Choice:
callback:
'Drupal\Core\TypedData\Plugin\DataType\LanguageReference::getAllValidLangcodes'
↣ PrimitiveType: { }
workflows.workflow.editorial:status Validatable ↣ PrimitiveType: { }
workflows.workflow.editorial:type Validatable PluginExists:
manager: plugin.manager.workflows.type
interface: Drupal\workflows\WorkflowTypeInterface
↣ PrimitiveType: { }
workflows.workflow.editorial:type_setti Validatable ValidKeys: '<infer>'
ngs
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type:
ngs.default_moderation_state workflow.type_settings.content_moderation
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type:
ngs.entity_types workflow.type_settings.content_moderation
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type:
ngs.states workflow.type_settings.content_moderation
workflows.workflow.editorial:type_setti Validatable ValidKeys: '<infer>'
ngs.states.archived
workflows.workflow.editorial:type_setti Validatable ↣ PrimitiveType: { }
ngs.states.archived.default_revision
workflows.workflow.editorial:type_setti Validatable Regex:
ngs.states.archived.label pattern: '/([^\PC])/u'
match: false
message: 'Labels are not allowed to span multiple lines or contain control
characters.'
↣ PrimitiveType: { }
workflows.workflow.editorial:type_setti Validatable ↣ PrimitiveType: { }
ngs.states.archived.published
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type: content_moderation.state
ngs.states.archived.weight
workflows.workflow.editorial:type_setti Validatable ValidKeys: '<infer>'
ngs.states.draft
workflows.workflow.editorial:type_setti Validatable ↣ PrimitiveType: { }
ngs.states.draft.default_revision
workflows.workflow.editorial:type_setti Validatable Regex:
ngs.states.draft.label pattern: '/([^\PC])/u'
match: false
message: 'Labels are not allowed to span multiple lines or contain control
characters.'
↣ PrimitiveType: { }
workflows.workflow.editorial:type_setti Validatable ↣ PrimitiveType: { }
ngs.states.draft.published
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type: content_moderation.state
ngs.states.draft.weight
workflows.workflow.editorial:type_setti Validatable ValidKeys: '<infer>'
ngs.states.published
workflows.workflow.editorial:type_setti Validatable ↣ PrimitiveType: { }
ngs.states.published.default_revision
workflows.workflow.editorial:type_setti Validatable Regex:
ngs.states.published.label pattern: '/([^\PC])/u'
match: false
message: 'Labels are not allowed to span multiple lines or contain control
characters.'
↣ PrimitiveType: { }
workflows.workflow.editorial:type_setti Validatable ↣ PrimitiveType: { }
ngs.states.published.published
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type: content_moderation.state
ngs.states.published.weight
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type:
ngs.transitions workflow.type_settings.content_moderation
workflows.workflow.editorial:type_setti Validatable ValidKeys: '<infer>'
ngs.transitions.archive
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type: workflows.transition
ngs.transitions.archive.from
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type: workflows.transition
ngs.transitions.archive.from.0
workflows.workflow.editorial:type_setti Validatable Regex:
ngs.transitions.archive.label pattern: '/([^\PC])/u'
match: false
message: 'Labels are not allowed to span multiple lines or contain control
characters.'
↣ PrimitiveType: { }
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type: workflows.transition
ngs.transitions.archive.to
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type: workflows.transition
ngs.transitions.archive.weight
workflows.workflow.editorial:type_setti Validatable ValidKeys: '<infer>'
ngs.transitions.archived_draft
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type: workflows.transition
ngs.transitions.archived_draft.from
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type: workflows.transition
ngs.transitions.archived_draft.from.0
workflows.workflow.editorial:type_setti Validatable Regex:
ngs.transitions.archived_draft.label pattern: '/([^\PC])/u'
match: false
message: 'Labels are not allowed to span multiple lines or contain control
characters.'
↣ PrimitiveType: { }
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type: workflows.transition
ngs.transitions.archived_draft.to
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type: workflows.transition
ngs.transitions.archived_draft.weight
workflows.workflow.editorial:type_setti Validatable ValidKeys: '<infer>'
ngs.transitions.archived_published
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type: workflows.transition
ngs.transitions.archived_published.from
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type: workflows.transition
ngs.transitions.archived_published.from.
0
workflows.workflow.editorial:type_setti Validatable Regex:
ngs.transitions.archived_published.label pattern: '/([^\PC])/u'
match: false
message: 'Labels are not allowed to span multiple lines or contain control
characters.'
↣ PrimitiveType: { }
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type: workflows.transition
ngs.transitions.archived_published.to
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type: workflows.transition
ngs.transitions.archived_published.weigh
t
workflows.workflow.editorial:type_setti Validatable ValidKeys: '<infer>'
ngs.transitions.create_new_draft
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type: workflows.transition
ngs.transitions.create_new_draft.from
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type: workflows.transition
ngs.transitions.create_new_draft.from.0
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type: workflows.transition
ngs.transitions.create_new_draft.from.1
workflows.workflow.editorial:type_setti Validatable Regex:
ngs.transitions.create_new_draft.label pattern: '/([^\PC])/u'
match: false
message: 'Labels are not allowed to span multiple lines or contain control
characters.'
↣ PrimitiveType: { }
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type: workflows.transition
ngs.transitions.create_new_draft.to
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type: workflows.transition
ngs.transitions.create_new_draft.weight
workflows.workflow.editorial:type_setti Validatable ValidKeys: '<infer>'
ngs.transitions.publish
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type: workflows.transition
ngs.transitions.publish.from
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type: workflows.transition
ngs.transitions.publish.from.0
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type: workflows.transition
ngs.transitions.publish.from.1
workflows.workflow.editorial:type_setti Validatable Regex:
ngs.transitions.publish.label pattern: '/([^\PC])/u'
match: false
message: 'Labels are not allowed to span multiple lines or contain control
characters.'
↣ PrimitiveType: { }
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type: workflows.transition
ngs.transitions.publish.to
workflows.workflow.editorial:type_setti NOT ❌ @todo Add validation constraints to ancestor type: workflows.transition
ngs.transitions.publish.weight
workflows.workflow.editorial:uuid Validatable Uuid: { }
↣ PrimitiveType: { }
------------------------------------------ ------------- ---------------------------------------------------------------------------------
11.x.composer require drupal/config_inspector — or manually install https://www.drupal.org/project/config_inspector/releases/2.1.5 or newer (which supports Drupal 11!)composer require drush/drushcontent_moderationvendor/bin/drush config:inspect --filter-keys=workflows.workflow.editorial --detail --list-constraintsFullyValidatable.Review.
None.
TBD
None.
N/A
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
sam152 commentedComment #3
sam152 commentedComment #4
wim leersWould be cool to have the
Workflowconfig entity type be the very first entity type with full config entity validation. Because it is the youngest config entity type addition to core. And imagine a drag-and-drop, snazzy decoupled JS configuration UI for it! With this implemented, that'd actually be possible :)Comment #16
wim leersSee the parent issue — several config entity types in Drupal core are now fully validatable! 🚀
Comment #17
wim leersI'll get this going…
Comment #19
wim leersThis MR gets us to 100% validatability, but at the last moment I discovered there was a whole new edge case:
predefined_states_workflow_test_type— where possible states are NOT defined in the config 😬Anyway, this should still serve as a good starting point 👍
P.S.: this might be blocked on #2871746: Sequences of mappings cannot merge keys from a subsequent definition of mapping keys?
Comment #20
wim leersThe test failures seem to have revealed a long-standing bug in how
%parent.%keyworks for a nested sequence item 😬 We'll need to fix that first.Comment #21
wim leersThe
ExistsInconstraint I wrote for this MR is already useful in another: see #3422862-4: Add validation constraints to book.settings.Comment #22
smustgrave commentedSeems this is postponed on #2871746: Sequences of mappings cannot merge keys from a subsequent definition of mapping keys
Also left a comment in [#15456258] about breaking that up.
Comment #23
wim leersThat's not yet certain. 😅 Plus, we can continue here regardless of that.