CB is Updating jos_users after SQL Action

13 years 2 months ago #155200 by sohoprospecting
CB is Updating jos_users after SQL Action was created by sohoprospecting
We use a SQL Action to set user language and timezone through our custom zipcode tables. This process happens on registration and set values to jos_users.params.

It was working well before update to cb 1.4. But right now there is a statement on cb that is updating the params field to '\n', canceling our update. I have tried to disable community builder's plugins one by one to try to figure out where this statement is coming from. But had no success. I Bet it is on cb core.

It is important for us to have user timezone set because we have users nationwide exchanging uddeim massages. Do you guys have any idea how to fix it?
--SQL Action
UPDATE jos_users users INNER JOIN jos_comprofiler com ON com.user_id  = users.id 
                       INNER JOIN zip_code zip        ON zip.zip_code = com.zipcode 
   SET users.params = CONCAT('language=en-GB',char(10),char(13),'timezone=-',zip.time_zone) 
 WHERE users.id = [user_id]
--Standard CB Update
UPDATE `jos_users`
   SET `name`='Rodrigo Kammer',`username`='rkammer',`email`='rodrigokammer@hotmail.com',`password`='1a128079be812d0fa84b51a6a06aa004:PVx5z19R4YXDuguqfVKYBe1cFSc0XlK5',`usertype`='Registered',`block`='1',`sendEmail`='0',`gid`='18',`registerDate`='2011-02-23 17:34:21',`activation`='54cdc8b422dda4344873b42f489f2006',`params`='\n'
 WHERE id='2678'

--

PHP Version: 5.2.17
Database Version: 5.0.77-log
Joomla Version: Joomla! 1.5.22 Stable
Community Builder: 1.4
CBSubs: 1.1.2
GroupJive: 2.0 (01/10/2011)

---
PHP - 5.2.14 / Joomla - 1.5.20 / CB - 1.2.3

Please Log in to join the conversation.

13 years 2 months ago - 13 years 2 months ago #155232 by krileon
Replied by krileon on topic Re: CB is Updating jos_users after SQL Action
I propose using incubator project CB Queries to perform your database query as it can be done AFTER profile update, registration, or any other CB trigger. This would ensure it's always fired regardless of the plan subscribed as would seam it's something you want for every user.

At any rate your query should be fine as long as you're giving the user the plan from the frontend as if the plan is being given from backend the Query fires fires THEN user save executes to save the users data (which will erase what your query just changed). This is not the case on frontend though and your queries changes should be fine if subscribed from frontend.

Given the \n reference am suspecting backend as an implode of \n is done on the params field, but should only be the case if params at all have been specified and are in an array. This can be seen on line 3789 of cb.core.php.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

13 years 2 months ago #155242 by sohoprospecting
Replied by sohoprospecting on topic Re: CB is Updating jos_users after SQL Action
We are actually having this problem when trying to register from frontend. There is no way to change the order in which the SQL Action plugin is going to run?

Also I will download and test CB Queries...

---
PHP - 5.2.14 / Joomla - 1.5.20 / CB - 1.2.3

Please Log in to join the conversation.

13 years 2 months ago #155250 by krileon
Replied by krileon on topic Re: CB is Updating jos_users after SQL Action

We are actually having this problem when trying to register from frontend. There is no way to change the order in which the SQL Action plugin is going to run?

Order seen in Plugin Management is also order of loading so the order at which plugins are executed, you can try moving it to last. Aside from this no. We've plans to improve the order of execution throughout CBSubs in a later release to prevent issues such as this.

Also I will download and test CB Queries...

I recommend the After Registration trigger.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: sohoprospecting

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.146 seconds

Facebook Twitter LinkedIn