I upgraded using the update.php script and it went fine. However, when I browse the site as any user, I get errors whenever I access any one of the nodes.


    * warning: array_keys() [function.array-keys]: The first argument should be an array in /usr/local/www/suikoden/modules/user.module on line 349.
    * warning: implode() [function.implode]: Bad arguments. in /usr/local/www/suikoden/modules/user.module on line 349.
    * user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT DISTINCT(p.perm) FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /usr/local/www/suikoden/includes/database.mysql.inc on line 120.

The offending line on user.module:349 is:

  // To reduce the number of SQL queries, we cache the user's permissions
  // in a static variable.
  if (!isset($perm[$account->uid])) {

// This line right here breaks.
    $result = db_query("SELECT DISTINCT(p.perm) FROM {role} r INNER JOIN {permission} p ON p.rid = r.rid WHERE r.rid IN (%s)", implode(',', array_keys($account->roles)));

// It seems that $account->roles is not an array, or something like that.
     
    $perm[$account->uid] = '';
    while ($row = db_fetch_object($result)) {
      $perm[$account->uid] .= "$row->perm, ";
    }
  }

These errors don't seem to occur on a fresh installation, so it appears to be something with the database. Any clues on what I can do to repair the problem?

Comments

robertDouglass’s picture

- Robert Douglass

-----
My Drupal book: Building Online Communities with Drupal, phpBB and WordPress

irwin’s picture

flexinode, notify, urlfilter, bbcode, quote.

(As an aside, I ended up switching the installation down to 4.6.8, so I don't technically require a fix for this issue anymore, but I've seen at least two other users post about it, so it might be of interest to others).

-- Irwin
* Drupal at work -> http://suikoden.mine.nu (Suikoden-themed Role-playing Game.)
* My other Drupal site -> http://scrapped.mine.nu (Video-game & Anime-themed Blog)

ilbeppe’s picture

I have exactly the same problem, someone know how to fix?

stanbroughl’s picture

I've just has this come up when i tried to create a donation product - anyone know how to fix it yet?

Lucy

ilbeppe’s picture

I have this error when i have enable de .htaccess.
Anyone know something?

stanbroughl’s picture

Turns out it might be the private messaging module thats causing the problem - i've disabled mine and the problem has stopped.

boy-1’s picture

Disabling Pvt Msg works for. I have upgraded form 4.6.7 to 4.7.2 with 1st checking modules compatibility.

zzlong’s picture

I have exactly the same error after upgrading from 4.7RC to 4.7.2. However I didn't install the private message module.

I search around and it seems the only known cause of the problem is priv. message module. I think there are something else also introduces this problem.

jdblank’s picture

this problem appears for me in the comments settings area and no comments can be published even though they appear in the DB.

tnfno’s picture

I get the same error when I try to convert an image to any type of product, when the product is saved. Here is the full error:

user warning: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '0, ptype, price, price_interval, price_unit, price_cycle, sku, query: INSERT INTO ec_product (nid, vid, 0, ptype, price, price_interval, price_unit, price_cycle, sku, hide_cart_link, is_recurring) VALUES('53', '55', '', 'generic', '', '0', '0', '-1', '', '0', '0') in /home/content/c/g/r/cgradmin/html/drp/includes/database.mysql.inc on line 120.

b.kumeling’s picture

Thanks for the tip! Turning off private messaging works fine with me.

romand’s picture

the same problem,
try on server console:
select * from users; - no ansver;

MySQLrefman:
When not running in strict mode, if you assign a value to a BLOB or TEXT column that exceeds the data type's maximum length, the value is truncated to fit. If the truncated characters are not spaces, a warning is generated. You can cause an error to occur and the value to be rejected rather than to be truncated with a warning by using strict SQL mode. See Section 5.2.5, “The Server SQL Mode”.

after altering users.data from longtext to varchar
select * from users; - seems work, but the site still down...
no additional modules instaled
Do you have any suggestion?