asipto / siremis

Web Admin Interface for Kamailio
http://www.siremis.org
98 stars 46 forks source link

Error when adding/updating/viewing Administrator usernames #2

Closed sam123sam123 closed 7 years ago

sam123sam123 commented 9 years ago

Administration > User Management > Click on any existing username. The browser goes blank.

Error in apache logs is: PHP Fatal error: Call to a member function getQuoted() on a non-object in /var/www/html/openbiz/bin/data/BizDataSql.php on line 237 This is on the latest Siremis v4.2.0 downloaded today

sam123sam123 commented 9 years ago

I believe the root cause is that siremis database has a table called "group". That is a reserved word in mysql that cannot be used as a table name. http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html

Do the following to prove it. mysql

USE siremis; SELECT * FROM group;

error

RENAME TABLE group TO group1; SELECT * FROM group1;

no error

Colward commented 9 years ago

yes. A workaround is to change the Table name to siremis.group in the table definitions on siremis/modules/system/do/*.xml files where it is defined. It works for me.

hecatae commented 8 years ago

anyone able to apply a fix to the siremis git to fix this permanently?

asummerell commented 8 years ago

Could someone please explain what the complete workaround is? I changed the table names in siremis/modules/system/do/*.xml files where it is defined as Colward suggested, but I am still having the problem. Do I also need to update the SQL table name?

Thank you!

Colward commented 8 years ago

My workaround is to use in the xml files not only the table name (group, a not valid table name in MySQL), instead the full name .. In my case, my DB is siremis, so I changed the table name "group" to the full name "siremis.group". If your DB is other you should change the name. And I repeat. I made the change and it worked for me. But nobody has validated it :( As I could see, in previous versions, in the SQL sentence the name is constructed by the DBName field and Table field of the BizDataObj. Maybe the problem is only in the tags with Table field and not DBName...

hecatae commented 8 years ago

looks like the issue is here in the mod.install.sql tables: https://github.com/asipto/siremis/blob/master/siremis/modules/system/mod.install.sql

table name group needs changing to siremis.group.

miconda commented 7 years ago

This has been fixed in latest master.