Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while adding a user #2

Closed
ChristianKnorr opened this issue Nov 30, 2016 · 2 comments
Closed

Error while adding a user #2

ChristianKnorr opened this issue Nov 30, 2016 · 2 comments

Comments

@ChristianKnorr
Copy link

PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'id' at row 1 in /var/www/intranet/radiusadmin/app/classes/RadEntityMapper.php:174\nStack trace:\n#0 /var/www/intranet/radiusadmin/app/classes/RadEntityMapper.php(174): PDOStatement->execute()\n#1 /var/www/intranet/radiusadmin/app/classes/RadEntityMapper.php(108): RadEntityMapper->saveAttrs('radreply', 'BockTablet', Array)\n#2 /var/www/intranet/radiusadmin/app/pages/users_edit.php(50): RadEntityMapper->save(Object(RadEntity))\n#3 /var/www/intranet/radiusadmin/public_html/index.php(44): include('/var/www/intran...')\n#4 {main}\n thrown in /var/www/intranet/radiusadmin/app/classes/RadEntityMapper.php on line 174, referer: http://<serverip>/radiusadmin/public_html/index.php?page=users_new

Any Ideas?

@Compizfox
Copy link
Owner

Compizfox commented Dec 1, 2016

Thanks for the bug report.

This is weird. It's been a while since I've worked on this project (I really have to pick it up again...) but I just looked into it and it seems the problem is that (for a new check/reply attribute) an empty string is inserted for the id in a query, which should have been NULL.

The weird part is that I can't reproduce this bug; it works fine here. After some research I think this might be because of MySQL Strict Mode, which seems to be enabled by default in MySQL 5.7.

You can check if this is enabled for you by executing this query: SHOW VARIABLES LIKE 'sql_mode';.

If this is indeed the cause of the problem, a quick workaround would be to disable Strict SQL Mode. Of course I understand this is not ideal and that the application should use NULL instead of empty string in such occasions. I'll be sure to fix this when I have time to look into it.

@Compizfox
Copy link
Owner

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants