Keyword

Error: 1136 Column Count Doesn't Match Value Count

  • Wire Creative
  • Wire Creative's Avatar Topic Author
  • Offline
  • Senior Member
More
10 years 10 months ago #121545 by Wire Creative
Hi, I'm trying to figure out how to fix a site that broke shortly after updating from Joomla 3.1.5 to 3.2.

After running that update, the site seemed fine until I logged out and tried to login again later. Now when I log in to the admin area, I get this error:

An error has occurred.
1136 Column count doesn't match value count at row 1 SQL=INSERT INTO hmwmh_user_usergroup_map (user_id,group_id) VALUES (549),(7)


There appears to be a syntax error which is writing "(549),(7)" instead of "(549,7)".

I've searched the site files and I think I may have found the offending bit of code in the file "administrator/components/com_k2/models/users.php" but I'm not smart enough to parse it correctly.

Here's line 420:
$query = "INSERT INTO #__user_usergroup_map VALUES (".$id.", ".implode("), (".$id.", ", $group).")";

Is the syntax on that last part correct, or could it be causing this error? It loses me at "implode" but it looks like the nesting may be off or there may be one too many commas.

I also updated K2 during this same work session, so it's possible it could be K2-related. Apologies in advance if I'm barking up the wrong tree here.

Thanks,
Greg

Please Log in or Create an account to join the conversation.

More
10 years 10 months ago #121546 by Lefteris
Hi. You need to check from what file the error comes from. The query in K2 model is being executed only when you try to move a user to some other user group, so probably the issue is somewhere else. Go to "Extensions" -> "Extension Manager" and then click "Database" from the sidebar. If there are warnings there click the Fix button.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Wire Creative
  • Wire Creative's Avatar Topic Author
  • Offline
  • Senior Member
More
10 years 10 months ago #121547 by Wire Creative
Replied by Wire Creative on topic Re: Error: 1136 Column Count Doesn't Match Value Count

Lefteris Kavadas wrote: Hi. You need to check from what file the error comes from. The query in K2 model is being executed only when you try to move a user to some other user group, so probably the issue is somewhere else. Go to "Extensions" -> "Extension Manager" and then click "Database" from the sidebar. If there are warnings there click the Fix button.


Unfortunately this error is locking me out of the entire admin area. It happens immediately after logging in and makes all other admin pages inaccessible.

I searched all the Joomla files for INSERT queries on the user_usergroup_map table. I found two: the one in this K2 user.php file and another in the admin files for the core users component. I can't follow the thread on the latter, but I know it's the more likely culprit.

Please Log in or Create an account to join the conversation.

More
10 years 10 months ago #121548 by Lefteris
Probably your database schema is out of date. Usually you can fix that by going to "Extensions Manger" -> "Database". However i don't know how to fix it in your case that is blocking the whole administration area. Keep in mind that this has nothing to do with K2. Try to comment out the line of the core users component where you found that query.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum