I'm trying to create a custom action that will use fields from a webform submission, but I'm unable to specify an action context of webform_fields without getting an error when adding the context. E.g., I have an action defined as
<?php
namespace Drupal\process_trial\Plugin\RulesAction;
use Drupal\rules\Core\RulesActionBase;
/**
* Provides a 'ProcessTrial' action.
*
* @RulesAction(
* id = "process_trial",
* label = @Translation("Process trial"),
* category = @Translation("Process Trial"),
* context = {
* "Webform Fields" = @ContextDefinition("webform_fields",
* label = @Translation("WebformFields"),
* description = @Translation("Fields in Webform submission")
* ),
* }
* )
*/
class ProcessTrial extends RulesActionBase {
/**
* {@inheritdoc}
*/
public function doExecute($object) {
dpm($object, 'Object');
}
}
When I then try to add a 'Process Trial' action, and click 'Switch to data selection', I get an immediate error of
InvalidArgumentException: Invalid values given. Values must be represented as an associative array. in Drupal\Core\TypedData\Plugin\DataType\Map->setValue() (line 76 of /home/newpe/public_html/web/core/lib/Drupal/Core/TypedData/Plugin/DataType/Map.php).
Create an action, as above in a module, and add that action to a role, then click 'Switch to data selection'
Closed: outdated
1.5
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.