?
avatar chillside
chillside
18 Jul 2016

Steps to reproduce the issue

in front or backand create new user -> field ID set 0 automaticly -> get error

Expected result

new user

Actual result

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 ' 2)' at line 3 SQL=INSERT INTO `#__user_usergroup_map` (`user_id`,`group_id`) VALUES (, 2)

System information (as much as possible)

Joomla! 3.6.0 Stable [ Noether ] 12-July-2016 21:14 GMT
Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
Apache/2.4.10 (Unix)
PHP 7.0.8
mysql 5.7.12

Additional comments

  • if you login - white page, logout - white page

Votes

# of Users Experiencing Issue
1/2
Average Importance Score
4.50

avatar chillside chillside - open - 18 Jul 2016
avatar infograf768
infograf768 - comment - 18 Jul 2016

Can't reproduce here.

avatar widmann-it
widmann-it - comment - 18 Jul 2016

If the problem can also understand. Every new user gets the ID 0

avatar csthomas
csthomas - comment - 18 Jul 2016
avatar csthomas
csthomas - comment - 18 Jul 2016

@chillside
Can you change line 373 for a few seconds:
from

                        ->values($this->id . ', ' . $group);

to

                        ->values($this->id . ',, ' . $group);

and test/try to add new user.
How it will look like the sql error/query?

avatar chillside
chillside - comment - 18 Jul 2016

@csthomas change 373 line

Сохранить не удалось из-за ошибки: 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 ', 2)' at line 3 SQL=INSERT INTO `#__user_usergroup_map` (`user_id`,`group_id`) VALUES (,, 2)
avatar chillside
chillside - comment - 18 Jul 2016

UPD. User created with this error, but his User Group is empty. And if i try edit this user - all fields is empty..

avatar chillside chillside - close - 18 Jul 2016
avatar chillside chillside - reopen - 18 Jul 2016
avatar csthomas
csthomas - comment - 18 Jul 2016

You have to check you #__users table. By phpMyadmin or similar.
Try to find users with id=0.

avatar chillside
chillside - comment - 18 Jul 2016

user with id 0 found.. first row in #users table

avatar csthomas
csthomas - comment - 18 Jul 2016

It may be mysql error.
Can you add row to #__users table manually.
Add one row with random data, after success delete it.

avatar chillside
chillside - comment - 18 Jul 2016

add new row in phpMyAdmin - user visible in admin panel and all fields is ok on edit user page

INSERT INTO `***_users` (`id`, `name`, `username`, `email`, `password`, `block`, `sendEmail`, `registerDate`, `lastvisitDate`, `activation`, `params`, `lastResetTime`, `resetCount`, `otpKey`, `otep`, `requireReset`) VALUES ('99999', 'name', 'username', 'ebala@ya.ru', '***********', '0', '0', '2016-07-18 00:00:00', '0000-00-00 00:00:00.000000', '', '', '0000-00-00 00:00:00.000000', '0', '', '', '0');
avatar csthomas
csthomas - comment - 18 Jul 2016

In Joomla Backend:
Global Configuration->Server Database Setttings:

  • check what value do you have at Database Type?
  • try to change to other contains "mysql" text.

If that not help then it may take time to find a solution.

avatar chillside
chillside - comment - 18 Jul 2016

DBtype is MySQLi

if set MySQL (PDO):

SQLSTATE[42000]: Syntax error or access violation: 1064 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 ' 2)' at line 3
avatar csthomas
csthomas - comment - 18 Jul 2016

Query which generate above error is suspicious.
Do you back this change?:

->values($this->id . ',, ' . $group);

If not do it.
And check again.

Back to mysqli.

  • Check your plugins.
    Disable for a while all not standard from user/system group. May some plugin generate errors.
avatar csthomas
csthomas - comment - 18 Jul 2016

I have forgotten to ask does a new added user by joomla has user id > 0?

avatar chillside
chillside - comment - 18 Jul 2016

in file /user.php#L317 i set default value

if i add user in admin user get ID 0 (visible in phpmyadmin), if add new row on phpmyadmin > id sets normal, from mysql query

avatar csthomas
csthomas - comment - 18 Jul 2016

The other solution may be to replace libraries/joomla libraries/cms and libraries/legacy by fresh from
https://github.com/joomla/joomla-cms/releases/download/3.6.0/Joomla_3.6.0-Stable-Full_Package.zip

Copy libraries/ to libraries_old/
Then delete cms, legacy and joomla directory from libraries/ [IMPORTANT]
Then copy from zip above directories to libraries/

avatar sovainfo
sovainfo - comment - 18 Jul 2016

Please use the forum to determine whether it is an issue with your environment or Joomla. Properly describe the issue here when it turns out to be an issue with Joomla!!

avatar chillside
chillside - comment - 18 Jul 2016

hmm.. what about "Reinstall Joomla core files" button in Joomal Update Page ? Dont gives a positive result.. Now I'll try your variant

avatar chillside
chillside - comment - 18 Jul 2016

@sovainfo i have this problem after update Joomla to 3.6.0 version and post it here.
I just want to find a solution..

avatar chillside
chillside - comment - 18 Jul 2016

lost AUTO_INCREMENT checkbox in #_users ID field. closed

avatar chillside chillside - close - 18 Jul 2016
avatar sovainfo
sovainfo - comment - 18 Jul 2016

So, use the proper channel for reporting issues! Again this is about Joomla! Software, not MySQL !

avatar Mindless999
Mindless999 - comment - 2 Aug 2016

It looks like the update for the MySQL did not put the AUTO_INCREMENT to this table, because for some reason the ID also was not primary Key. I had this issue as well after upgrading Joomla to the latest version


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11171.

Add a Comment

Login with GitHub to post a comment