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.
$result
is used earlier in actions_do
. It is later overriden with an ->execute() call. This should fix it.
... Not sure it's critical, but it's causing errors in testing on head.
Beginning of function....
$actions = array();
$available_actions = action_list();
$result = array();
if (is_array($action_ids)) {
$conditions = array();
foreach ($action_ids as $action_id) {
End of function....
}
}
$stack--;
return $result;
$result being overriden....
$query = db_select('actions');
$query->addField('actions', 'aid');
$query->addField('actions', 'type');
$query->addField('actions', 'callback');
$query->addField('actions', 'parameters');
$query->condition('aid', $conditions, 'IN');
$result = $query->execute();
foreach ($result as $action) {
$actions[$action->aid] = $action->parameters ? unserialize($action->parameters) : array();
$actions[$action->aid]['callback'] = $action->callback;
$actions[$action->aid]['type'] = $action->type;
}
Comment | File | Size | Author |
---|---|---|---|
result.patch | 788 bytes | RobLoach | |
Comments
Comment #0.0
RobLoachUpdated issue summary.
Comment #0.1
RobLoachUpdated issue summary.
Comment #1
effulgentsia CreditAttribution: effulgentsia commentedI see the variable collision in the code, but I don't see any HEAD tests that are currently broken, nor do I see a failure locally that this fixes. Regardless, removing the collision makes sense.
Comment #2
effulgentsia CreditAttribution: effulgentsia commentedActually, we should find out why there isn't a test in HEAD that catches this, and add it.
Comment #3
RobLoachSorry, but I'm not making a test for this. It's simple variable name conflict degregation from #1008166: Actions should be a module. Agreed that it's not really critical though.
Comment #4
sunUnfortunately, we pretty much removed each and every test coverage for actions through the removal of Trigger module.
So, two things:
1) Let's fix this blatant mistake.
2) Let's create a follow-up issue to add some serious test coverage for Actions module.
That is, because the entire functionality is pretty much untested, so adding a single, uncoordinated test assertion for this here doesn't really improve the situation.
Comment #5
catchCreated the follow-up: #1797658: Add test coverage for Actions module.
Committed/pushed the patch.
Comment #6.0
(not verified) CreditAttribution: commentedUpdated issue summary.