Comments

info@zrix.com’s picture

Assigned: Unassigned » info@zrix.com
Status: Active » Needs review
StatusFileSize
new1.17 KB

Status: Needs review » Needs work

The last submitted patch, actions.patch, failed testing.

aspilicious’s picture

StatusFileSize
new1.15 KB

I'll try to help things going...
A try to fix previous patch

1) remove windows line endings (check)
2) 2 spaces indentation (check)
3) no tabs (check)
4) readable patch name... (check)
5) path name (check)
6) test on local machine (check)

Ok lets see what bot thinks

aspilicious’s picture

Status: Needs work » Needs review
aspilicious’s picture

Ok it passed...
Now the real reviews can come in

MichaelCole’s picture

cwgordon7’s picture

The current code reads:

function actions_get_all_actions() {
  $actions = &drupal_static(__FUNCTION__, array());
  if (count($actions)) {
    return $actions;
  }
  else {
    $actions = db_query("SELECT aid, type, callback, parameters, label FROM {actions}")->fetchAllAssoc('aid', PDO::FETCH_ASSOC);
    foreach ($actions as &$action) {
      $action['configurable'] = (bool) $action['parameters'];
      unset($action['parameters']);
      unset($action['aid']);
    }
  }
  return $actions;
}

this could be shortened to:

function actions_get_all_actions() {
  $actions = &drupal_static(__FUNCTION__);
  if (!isset($actions)) {
    $actions = db_query("SELECT aid, type, callback, parameters, label FROM {actions}")->fetchAllAssoc('aid', PDO::FETCH_ASSOC);
    foreach ($actions as &$action) {
      $action['configurable'] = (bool) $action['parameters'];
      unset($action['parameters']);
      unset($action['aid']);
    }
  }
  return $actions;
}

I think that the second is more concise and more readable.

silverwing’s picture

Issue summary: View changes
mgifford’s picture

Assigned: info@zrix.com » Unassigned

Unassigning.

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.