Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In d7 parameters can be defined using the following keys:
* - restriction: (optional) Restrict how the argument for this parameter may
* be provided. Supported values are 'selector' and 'input'.
* - default mode: (optional) Customize the default mode for providing the
* argument value for a parameter. Supported values are 'selector' and
* 'input'. The default depends on the required data type.
We need the same functionality for d8. Although we cannot leverage this in the very near future, imo we should define that soon so people can already specify it when writing actions.
Comments
Comment #1
Torenware CreditAttribution: Torenware as a volunteer commentedFago --
Could you elaborate a bit on this?
I'm starting to work in areas of the code that process context, and it's not clear what "pre-configured" or "mapped only" mean.
A \Drupal\rules\Context\ContextConfig object contains a protected $config member that contains
It's not clear what these do, or how they need to map to what APIs are used to manipulate contexts for actions or conditions. The tests don't really cover this yet.
Comment #2
fagothis issue is actually fixed, see ContextDefinitionInterface that's part of Rules.
@question: Look at the respective methods of the ContextConfig object, they describe what the keys are up for. They keys really are just the internal storage format and shouldn't be of interested for you - you can and should always use the ContextConfig class outside of RulesExpression classes.
If that's not clear, I'm happy to explain the concepts in person also.