[#2448] Cannot get SQL action to execute in backend

13 years 4 weeks ago - 13 years 3 weeks ago #158253 by softforge
I have the following SQL action set up for a plan:
UPDATE jos_comprofiler SET cb_courses = IF(cb_courses='', 'Basic Proofreading', CONCAT(cb_courses, '|*|Basic Proofreading')) WHERE user_id = [user_id]
However this does not execute when assigning the plan from the backend (it also works fine in PHPMyAdmin when replacing [user_id]).

Am I missing something here? Should this not work?

On a related note, what I am doing is adding an additional selection to a (read-only) multi-checkbox field. Ideally the CB Fields plugin would have an additional "Operator" something like "Append: Field = Field |*| Value" which would do what my UPDATE statement is doing. Then I wouldn't need to use an SQL action.

Many thanks in advance

If you like our plugins, please consider writing a review on the Joomla Extension Directory or the Community Builder Directory ...

Please Log in to join the conversation.

13 years 4 weeks ago #158314 by softforge
Replied by softforge on topic Re: Cannot get SQL action to execute in backend
I forgot to mention I am using J v1.5.22, CB v1.4 and CBSubs v1.1.2.

Many thanks

If you like our plugins, please consider writing a review on the Joomla Extension Directory or the Community Builder Directory ...

Please Log in to join the conversation.

13 years 4 weeks ago - 13 years 4 weeks ago #158390 by krileon
There's a known issue with updating _users and _comprofiler tables with SQL Actions and giving users subscriptions from backend. Due to the order of execution any of your changes done via SQL Actions is over-written by the POST data during the save action of a users profile. We've plans to rework the order of execution so this won't happen any further in a later release. For SQL Actions to work by adding backend subscriptions you must use the Import feature.


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 4 weeks ago #158396 by softforge
Replied by softforge on topic Re: Cannot get SQL action to execute in backend
I see, that makes sense, thanks for you response.

Would you also consider adding the Append option to the CB Fields Operator so that additional multi-select values can be added (rather then overwritten) when subscribing to a plan. This would remove the need for using the SQL Action in this example.

Many thanks

If you like our plugins, please consider writing a review on the Joomla Extension Directory or the Community Builder Directory ...

Please Log in to join the conversation.

13 years 4 weeks ago #158408 by krileon
I believe this is already the case if your value is "|*|Value" (without quotes). Have not tested, but worth trying. At any rate have created a feature ticket for further review.

#2448


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 3 weeks ago #158731 by softforge
Replied by softforge on topic Re: Cannot get SQL action to execute in backend
You are (very nearly) right. After further testing, any multi-select field value does actually get appended automatically with the correct separator (where as normal fields just get overwritten). It doesn't need the "|*|" as that is added automatically so adding "|*|Value" results in "|*||*|Value" in the database meaning you just need "Value"

This is excellent and makes a lot of sense. Thank you for such intelligent software (although I couldn't find this feature documented anywhere).

:)

If you like our plugins, please consider writing a review on the Joomla Extension Directory or the Community Builder Directory ...

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.247 seconds

Facebook Twitter LinkedIn