After enabling this module, at node ( with big taxonomy vocab. attached) edit page I get drupal warning:

warning: preg_match() expects parameter 2 to be string, array given in bootstrap.inc on line 670

At the same time, at another node ( without taxonomy attached at all ) edit page I get:

warning: Invalid argument supplied for foreach() in batax.module on line 46.

Comments

sdrycroft’s picture

Try version 1.1

sdrycroft’s picture

Priority: Critical » Minor

Christ, just noticed this was labelled as "critical" - WTF? Crea, really, both the errors you posted are PHP Warnings, which straight away would make this problem minor.

crea’s picture

Version: 5.x-1.0 » 5.x-1.1

My mistake with priority.

I tried 1.1, warnings at node edit disappeared, but I get another warning after I submit different node types:

warning: Invalid argument supplied for foreach() in batax.module on line 81.

Strange that this warning is printed only at first node view and disappears at following ones

break9’s picture

I have the same issue.... any actual fix?

break9’s picture

i rolled back the version and it didn't fix the issues

kars-t’s picture

Status: Active » Needs review

I have an error like this in line105.
It seems that a node without linked taxonomy will generate the error. So I added an check "if(!empty($node->taxonomy)){" and the error should go away.

function batax_nodeapi(&$node, $op, $three, $four){
  switch($op){
    case 'submit':

      if(!empty($node->taxonomy)){

        foreach($node->taxonomy as $vocabulary => $vocabulary_field){
          if(substr($vocabulary,-4) == '-new'){
            $vid = array_shift(explode("-",$vocabulary));
            $node->taxonomy[$vid] = _split_field($vocabulary_field, $vid);
          }
        }

      }

      break;
  }
}
sdrycroft’s picture

Status: Needs review » Fixed

These are all fixed in the latest 6 version

sdrycroft’s picture

Status: Fixed » Closed (fixed)