taxonomy.admin.inc
On line 282,
$total_entries = db_query(db_rewrite_sql('SELECT count(*) FROM {term_data} t INNER JOIN {term_hierarchy} h ON t.tid = h.tid WHERE t.vid = %d', 't', 'tid'), $page_increment, 0, NULL, $vocabulary->vid);

should be :
$total_entries = db_query(db_rewrite_sql('SELECT count(*) FROM {term_data} t INNER JOIN {term_hierarchy} h ON t.tid = h.tid WHERE t.vid = %d', 't', 'tid'), $vocabulary->vid);

Only $vocabulry->vid is needed, with the wrong arguments in db_query, t.vid must always be equal to $page_increment (==100)

Comments

ebelrose’s picture

in fact, should be
$total_entries = db_result(db_query(db_rewrite_sql('SELECT count(*) FROM {term_data} t INNER JOIN {term_hierarchy} h ON t.tid = h.tid WHERE t.vid = %d', 't', 'tid'), $vocabulary->vid));

$total_entries is supposed to be an integer.

ebelrose’s picture

Related to error:
warning: preg_match() expects parameter 2 to be string, resource given in /includes/bootstrap.inc on line 777
on page admin/content/taxonomy/%taxonomy_vocabulary

http://drupal.org/node/658412
http://drupal.org/node/641712

zoo’s picture

Hello,

I apologize for my question, I'm not an expert of Drupal. I get this error in Taxonomy adding/views terms.

warning: preg_match() expects parameter 2 to be string, resource given in /includes/bootstrap.inc on line 777

Is there something I should do in order to resolve the problem?

Thank You

zoo

Anonymous’s picture

I get the same error as well, taxonomy tag option selected.

Anonymous’s picture

Version: 6.14 » 6.16

I also get the warning:

preg_match() expects parameter 2 to be string, resource given in /drupal/includes/bootstrap.inc on line 777.

on the page admin/content/taxonomy/1 but strangely not on admin/content/taxonomy/2. One difference is that 1 is a free tagging taxomomy and 2 is not.

Anonymous’s picture

Update: Drupal for firebug module issue #598016: Don't call check_plain() on resource variables might be the culpit, has a fix that seems to solve it for me.

mattcasey’s picture

I can't edit my vocabulary or its terms. Last time I had updated a term I was using drupal 6.15 and now using 6.16. After I submit form, drupal says it has updated and saved everything, but the changes are missing when I go back. I am using neither free tags nor DrupalForFirebug.

I get the first error on every page, the other errors only on the Terms List page:

warning: preg_match() expects parameter 2 to be string, array given in /var/www/vhosts/graphiclabinc.com/httpdocs/includes/bootstrap.inc on line 777.
warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in /var/www/vhosts/graphiclabinc.com/httpdocs/includes/database.mysqli.inc on line 323.
warning: Illegal offset type in isset or empty in /var/www/vhosts/graphiclabinc.com/httpdocs/includes/common.inc on line 912.
warning: Illegal offset type in isset or empty in /var/www/vhosts/graphiclabinc.com/httpdocs/includes/common.inc on line 912.

mattcasey’s picture

I restored a Backup I had made before editing my taxonomy terms and everything's allright again. Was not able to identify the actual problem though :/

dpearcefl’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

Is this issue still occurring in the current version of Drupal v6?

dpearcefl’s picture

Status: Postponed (maintainer needs more info) » Active

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.