The regexp used to calculate the result of the function is wrong, giving the contrary as expected.
(The confusion would probably be because of the initial ^ in the reg exp. It just means begin of string, not a NOT operation)

I suggest changing the code to this (last line of _views_bulk_operations_is_actions_6):

// return (bool) preg_match('/^5.[x1-9]-2.[x1-9]/', $info['version']); WRONG
return (bool) (substr($info['version'],0,1)>=6); //OK

as substr works faster than preg_match. I think it covers all possible cases...

Comments

scb’s picture

Due to that change you also have to change function _views_bulk_operations_get_custom_actions()
so the check for _views_bulk_operations_is_actions_6 is the opposite:

function _views_bulk_operations_get_custom_actions() {
  $actions = array();
  if (!_views_bulk_operations_is_actions_6()) { //Note the prepended not (!)
  // ...
infojunkie’s picture

The purpose of the original function is this: check whether we're using actions 5.x-2.x, and that's what they're calling D6-style. The function does not check that we're in Drupal 6.

Is the module behaving wrongly or did you try to use this function in our own code?

infojunkie’s picture

Status: Active » Closed (fixed)

I'll close this issue unless anyone minds.

scb’s picture

Priority: Critical » Normal

OK, thanks for the info... I was trying to implement some actions to add to a bulk operations view, but they wouldn't work with the actions 6 style, but there must have been some misconfiguration on my side, since it no longer throws any error.
Thanks again.