- Status changed to Fixed
10 months ago 7:35pm 19 January 2024 Automatically closed - issue fixed for 2 weeks with no activity.
When using a variable of type "View result variable" and the arguments field is empty, it shows the following warning when executing the routine:
Deprecated function: explode(): Passing null to parameter #2 ($string) of type string is deprecated in Drupal\business_rules\Plugin\BusinessRulesVariable\ViewResultVariable->evaluate() (line 223 of modules/contrib/business_rules/src/Plugin/BusinessRulesVariable/ViewResultVariable.php).
Drupal\business_rules\Plugin\BusinessRulesVariable\ViewResultVariable->evaluate(Object, Object) (Line: 94)
Drupal\business_rules\Entity\Variable->evaluate(Object) (Line: 708)
Drupal\business_rules\Util\BusinessRulesProcessor->evaluateVariable(Object, Object) (Line: 673)
Drupal\business_rules\Util\BusinessRulesProcessor->evaluateVariables(Object, Object) (Line: 501)
Drupal\business_rules\Util\BusinessRulesProcessor->executeAction(Object, Object) (Line: 344)
Drupal\business_rules\Util\BusinessRulesProcessor->processItems(Array, Object, 'alertas_compara_valores') (Line: 384)
Drupal\business_rules\Util\BusinessRulesProcessor->processItems(Array, Object, 'alertas_envio_p1') (Line: 289)
Drupal\business_rules\Util\BusinessRulesProcessor->processTriggeredRules(Array, Object) (Line: 198)
Drupal\business_rules\Util\BusinessRulesProcessor->process(Object) (Line: 207)
Drupal\business_rules\EventSubscriber\BusinessRulesListener->process(Object, 'business_rules.cron_runs', Object)
...
If the result of the arguments is null, apply an empty string. Line to change.
// Get settings.
$defined_view = $variable->getSettings('view');
$view_fields = $variable->getSettings('view_html');
$args = $variable->getSettings('arguments');
$event_variables = $event->getArgument('variables');
to
// Get settings.
$defined_view = $variable->getSettings('view');
$view_fields = $variable->getSettings('view_html');
$args = $variable->getSettings('arguments') ?? "";
$event_variables = $event->getArgument('variables');
Validate the proposed fix.
None.
None.
None.
Fixed
2.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Automatically closed - issue fixed for 2 weeks with no activity.