[SOLVED] SQL Actions Not Working

8 years 2 months ago - 8 years 2 months ago #156835 by Robert_ITMan
krileon & CB team,

Really appreciate your reply! You inspired me to keep trying and after a few hours I found the problem is that a field with null value won’t concat in your code (works fine in phpmyadmin and other uses)... so I have a work around for us where we first clear the null value. The following example is for type Activation as we have added in all our plans (replace Annual Membership for each plan) and we have one for each action (replace ACTIVATED with RENEWED, EXPIRED, or DEACTIVATED for each type):

!! This Works:
UPDATE `jos_comprofiler` SET `cb_adminnotes` = '---' WHERE `id` = [user_id] AND `cb_adminnotes` IS NULL LIMIT 1;
UPDATE `jos_comprofiler` SET `cb_adminnotes` = CONCAT(' ACTIVATED Annual Membership<br /><br />',`cb_adminnotes`) WHERE `id` = [user_id] LIMIT 1;


This script allows us to track all changes to CB subscriptions in each user's profile by simply adding a time stamp and description of each action to the beginning of our cb_adminnotes field ‘Admin Notes’ which we have under a tab we created called ‘Admin Only’ which only our administrators can access.

Feature request for CB Fields:
The CB Team could make this easier for us by simply adding a few lines of code to your CB Fields CBsubs plugin so it has the option to CONCAT at either the beginning or end of the field (it currently only let us replace what is there already).
8 years 2 months ago #157438 by krileon
Changes to _comprofiler table will NOT work when giving a user a subscription from backend. This is due to order of execution. It WILL work if you "import" a subscription for the user and it WILL work on frontend. This is a known issue we plan to address by fixing order of execution. Please ensure you're only having issues on frontend and test with debug mode on and maximum error reporting set in Joomla global configuration (helps see if an SQL error is present).

The CB Team could make this easier for us by simply adding a few lines of code to your CB Fields CBsubs plugin so it has the option to CONCAT at either the beginning or end of the field (it currently only let us replace what is there already).

Not really possible to do this without causing a simple plugin to become complicated, which is why we provided SQL Actions for those who need more advance control.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
8 years 2 months ago - 8 years 2 months ago #157454 by Robert_ITMan
Did you notice I have the SQL action working? I edited my note to add !! This Works

Happy to hear changes made to subscriptions in back-end will be fixed, but this not my issue here.

Also, my feature request for CB fields would not complicate the plug in, it would make it better and more functional - instead of replacing what is there it lets you add to what is there already.

I guess you are busy - thanks anyways.
8 years 2 months ago #157562 by krileon

Did you notice I have the SQL action working? I edited my note to add !! This Works

Thank you for clarification.

Happy to hear changes made to subscriptions in back-end will be fixed, but this not my issue here.

Hoping fixed for next release, but can provide no guarantee; seams a critical bug. Good thing is it works fine for frontend and import subscriptions.

Also, my feature request for CB fields would not complicate the plug in, it would make it better and more functional - instead of replacing what is there it lets you add to what is there already.

Thus far no intentions to extend CB Fields to be as such, please continue to use SQL Actions for more complex usage.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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: Robert_ITMan
8 years 2 months ago #158418 by Ornithologist
What are the values we can use in our SQL Actions? Can we get the code to show the amount donated? Would [amount] work?

The instructions state:

CB user fields can be substituted (e.g. [user_id] or '[username]'). IMPORTANT: always quote text strings (all user data is SQL-escaped). You can also use: [plan_id], [subscription_id], and where applicable (replaced by a 0 if not available): [replaced_plan_id], [parent_plan_id], [parent_subscription_id]
8 years 2 months ago - 8 years 2 months ago #158530 by krileon
The only CBSubs substitutions available are the ones provided to you by the instructions. The amount and such as far as I am aware is not available at this time.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
Moderators: beatnantkrileon
Time to create page: 0.400 seconds
Facebook Twitter Google LinkedIn