[SR-Users] Siremis error Call to a member function getQuoted()

canuck15 canuck15 at hotmail.com
Tue Mar 24 15:41:52 CET 2015


Thanks for the suggestion.

It doesn't seem to work.  It produces the following query.

SELECT T0.id, T0.name, T0.description FROM group T0 INNER JOIN 
`user_group` TX ON TX.group_id = T0.id WHERE TX.user_id = '1'

On 3/23/2015 2:59 PM, Daniel-Constantin Mierla wrote:
> The right solution is to enclose the table name in between the 
> quotations marks that allow any value there, including the reserved 
> keywords.
>
> In mysql you can use the back ticks, e.g:
>
> SELECT * FROM `group`;
>
> The above will just work. But is not standard SQL, just mysql 
> specific. That was the purpose of the getQuoted() function, which came 
> as patch to make siremis work with postgress. But apparently the patch 
> was not dealing with the association case. IIRC, postgress uses double 
> quotes instead of back ticks.
>
> As a shorter fix would be using:
>
> $xtable = "`" . $assoc["XTable"] . "`";
>
> In this way, you don't need to rename the table and change the name of 
> it on php code.
>
> Cheers,
> Daniel
>
> On 23/03/15 16:20, canuck15 wrote:
>> Ok, so the complete fix is:
>>
>> edit ...openbiz/bin/data/BizDataSql.php
>> go to line 237
>> replace the line with.
>>
>> $xtable = $assoc["XTable"];
>>
>> mysql -p
>> > USE siremis;
>> > RENAME TABLE group TO grouptable;
>>
>> Or pick some other new name for the group table.
>>
>> edit ..siremis/modules/system/do
>>
>> Go through all the files in that directory and change
>> Table="group"
>>
>> To
>>
>> Table="grouptable"
>>
>> Or whatever the new name given to the group table is.  Now it all 
>> seems to work.
>>
>>
>> On 3/23/2015 7:03 AM, canuck15 wrote:
>>> Hi,
>>>
>>> I figured that part out which is when I got the database error about 
>>> the "group" table.  So I will need to find where to change that 
>>> table name.  I should have mentioned that.
>>>
>>> On 3/23/2015 1:18 AM, Daniel-Constantin Mierla wrote:
>>>> The issue is calling a function which is not member of the object 
>>>> referred to.
>>>>
>>>> We will look into fixing it properly, for the moment do following 
>>>> changes:
>>>>
>>>> - editi the file: /var/www/html/openbiz/bin/data/BizDataSql.php
>>>> - go to line 237
>>>> - replace the line with:
>>>>
>>>> $xtable = $assoc["XTable"];
>>>>
>>>> Thanks for reporting and troubleshooting.
>>>>
>>>> Cheers,
>>>> Daniel
>>>>
>>>> On 23/03/15 02:52, canuck15 wrote:
>>>>> I think I found the root cause.
>>>>>
>>>>> 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
>>>>>
>>>>> On 3/21/2015 4:39 PM, canuck15 wrote:
>>>>>> When you add/update/view Administrator usernames
>>>>>>
>>>>>> To reproduce
>>>>>> 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
>>>>>>
>>>>>> I am using CentOS v6.6, php v5.3.3
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>>>>> sr-users at lists.sip-router.org
>>>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>>
>>>> -- 
>>>> Daniel-Constantin Mierla
>>>> http://twitter.com/#!/miconda  -http://www.linkedin.com/in/miconda
>>>> Kamailio World Conference, May 27-29, 2015
>>>> Berlin, Germany -http://www.kamailioworld.com
>>>>
>>>>
>>>> _______________________________________________
>>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>>>> sr-users at lists.sip-router.org
>>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>
>>
>>
>>
>> _______________________________________________
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>> sr-users at lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
> -- 
> Daniel-Constantin Mierla
> http://twitter.com/#!/miconda  -http://www.linkedin.com/in/miconda
> Kamailio World Conference, May 27-29, 2015
> Berlin, Germany -http://www.kamailioworld.com
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20150324/6521cadc/attachment.html>


More information about the sr-users mailing list