daloradius icon indicating copy to clipboard operation
daloradius copied to clipboard

Can't assign plan in existing user

Open baguswahyu opened this issue 4 years ago • 6 comments

when I assign plan to user, always error

Database error
Error Message: DB Error: syntax error
Debug info: UPDATE userbillinfo SET contactperson='', planname='1GB-per-week', company='', email='', phone='', paymentmethod='', cash='', creditcardname='', creditcardnumber='', creditcardverification='', creditcardtype='', creditcardexp='', address='', city='', state='', country='', zip='', notes='', changeuserbillinfo='0', lead='', coupon='', ordertaker='', billstatus='', nextinvoicedue='0', billdue='0', postalinvoice='', faxinvoice='', emailinvoice='', updatedate='2020-08-15 19:28:46', updateby='administrator' WHERE username='bagus' [nativecode=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 'lead='', coupon='', ordertaker='', billstatus='', nextinvoicedue='0', billdue='0' at line 1]

check video from attachment (inside zip) Kazam_screencast_00024.zip

baguswahyu avatar Aug 15 '20 11:08 baguswahyu

Same as #185 and #188.

MiguelVis avatar Feb 14 '21 23:02 MiguelVis

Hi @baguswahyu.

Please, check if the following SQL query solves the issue:

ALTER TABLE `userbillinfo`
	CHANGE COLUMN `lastbill` `lastbill` DATE NULL DEFAULT NULL AFTER `billstatus`,
	CHANGE COLUMN `nextbill` `nextbill` DATE NULL DEFAULT NULL AFTER `lastbill`;

MiguelVis avatar Feb 22 '21 21:02 MiguelVis

Hi,

I believe I have the same issue. Any update to 'userbillinfo' results in a 1064 syntax error near 'lead='',coupon''...

The issue occurs for me in daloradius in Edit User (mng-edit.php) when selecting a plan, or updating Billing Info. Interestingly, if I add a new user (mng-new.php) including billing info, it works fine.

Its like the 'lead' field is locked but I think the list values is only via the web page (mng-edit.php, values -->Internet, Friend-Referal, News Medium, Advertisement). The daloradius sql template does'nt show anything strange. Manual sql update works if I leave out the 'lead' field. Insert values manually always fails.

Am surprised others have not had similar issues? (if it is a db issue) Your slq column change above did not work for me. Also I cant play "Kazam_screencast_00024.mp4 message.

Luckily I dont need the billing info but updating the user plan would be handy.

Running version 1.1-3 BETA / 06 Dec 2019 on fedora-31, Mysql 8.0.22 sql-error

kpteahan avatar Mar 01 '21 23:03 kpteahan

Hi @kpteahan.

After you did apply the mentioned ALTERs, did you created a user and then update it?

I mean maybe the issue stills in old records but not in new records after the apply of SQL ALTERs.

Could you test it please?

MiguelVis avatar Mar 02 '21 07:03 MiguelVis

 yes, I purged the data in the database.  Not sure if I did that after.It is working, I can now select a plan without issues.Still getting an error when updating billing info, but now I can apply plans.Will test my manual scripts again to check it. Note that changing the columns I had to change lastbill, nextbill, creationdate and updatedate, otherwise I got invalid values (error1067).

tks

----- Original Message ----- From: "lirantal/daloradius" To:"lirantal/daloradius" Cc:"kpteahan" , "Mention" Sent:Mon, 01 Mar 2021 23:13:55 -0800 Subject:Re: [lirantal/daloradius] Can't assign plan in existing user (#179)

Hi @kpteahan [1]. 

After you did apply the mentioned ALTERs, did you created a user and

then update it?

I mean maybe the issue stills in old records but not in new records

after the apply of SQL ALTERs.

Could you test it please? 

—

You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub [2], or unsubscribe [3]

Links:

[1] https://github.com/kpteahan [2] https://github.com/lirantal/daloradius/issues/179#issuecomment-788675796 [3] https://github.com/notifications/unsubscribe-auth/ARNUCFFHTBAJWOI2OZENBOLTBSF3HANCNFSM4QAHKQYQ

kpteahan avatar Mar 02 '21 23:03 kpteahan

Hi MiguelVis, i just have installed the application and have assign plan issue too, I´did apply the ALTERs and still have the same error message in new record. Like kpteahan said, It was necesary to ALTER creeationdate and updatedate, Any idea?

iguiza avatar Mar 20 '22 20:03 iguiza