Hi,
i created a Node View filtered by taxonomy term (ID terms with dept) passed by arguments.
i user php default arguments and my code return a terms id array for filtering nodes.
//NEL CASO IN CUI STO VISUALIZZANDO UN NODO
//$args=new Array();
if (arg(0) == 'node' && is_numeric(arg(1)) ) {
//$node = node_load( (int)arg(1));
//$terms = taxonomy_node_get_terms($node);
$result = db_query(db_rewrite_sql('SELECT t.tid FROM {term_node} r INNER JOIN {term_data} t ON r.tid = t.tid INNER JOIN {vocabulary} v ON t.vid = v.vid WHERE r.vid = %d ORDER BY v.weight, t.weight, t.name', 't', 'tid'), (int)arg(1));
while ($t= db_fetch_object($result)) {
$args[]= (string)$t->tid;
}
}
//NEL CASO IN CUI STO VISUALIZZANDO lLA TASSONOMIA
if (arg(0) == 'taxonomy' && is_numeric(arg(2)) ) {
$args[]=(string)arg(2);
}
return $args;
when i place a block i read these warnings
warning: Illegal offset type in isset or empty in D:\server\wamp\www\drupal\modules\taxonomy\taxonomy.module on line 1011.
warning: Illegal offset type in D:\server\wamp\www\drupal\modules\taxonomy\taxonomy.module on line 1012.
warning: Illegal offset type in D:\server\wamp\www\drupal\modules\taxonomy\taxonomy.module on line 1015.
warning: preg_match() expects parameter 2 to be string, array given in D:\server\wamp\www\drupal\sites\all\modules\views\includes\handlers.inc on line 802.
warning: preg_match() expects parameter 2 to be string, array given in D:\server\wamp\www\drupal\sites\all\modules\views\includes\handlers.inc on line 807.
warning: preg_match() expects parameter 2 to be string, array given in D:\server\wamp\www\drupal\includes\bootstrap.inc on line 777.
warning: preg_match() expects parameter 2 to be string, array given in D:\server\wamp\www\drupal\includes\bootstrap.inc on line 777.
warning: preg_match() expects parameter 2 to be string, array given in D:\server\wamp\www\drupal\includes\bootstrap.inc on line 777.
warning: preg_match() expects parameter 2 to be string, array given in D:\server\wamp\www\drupal\includes\bootstrap.inc on line 777.
warning: preg_match() expects parameter 2 to be string, array given in D:\server\wamp\www\drupal\includes\bootstrap.inc on line 777.
warning: preg_match() expects parameter 2 to be string, array given in D:\server\wamp\www\drupal\includes\bootstrap.inc on line 777.
if i put the block on rigth sidebar warning on bootstrap.inc on line 777 doesn't exist.
i suppose that is can be a render order problem.
HOW TO SOLVE?
thans in advance.
Comments
Comment #1
faffo commentedissue settings edited
Comment #2
merlinofchaos commentedIn Views 2, your argument default code should return a single argument, not an array.
Comment #3
faffo commentedbut if i change my code
in
these warnings appears:
WHY?
Comment #4
dagmarBecause you don't respect the syntax of implode function
Should be:
Comment #5
faffo commentedwhat's a horrible mistake... :S
thanks