[#6603] CB Code Field not Saving

6 years 11 months ago - 6 years 11 months ago #293527 by bilal.abdeen
[#6603] CB Code Field not Saving was created by bilal.abdeen
This is a duplicate of the topic (www.joomlapolis.com/forum/13-general-plugins/236492-cb-code-field-not-saving). I was asked by Kyle to open a ticket in this forum, instead of the general one.

Thank you very much for your effort and time to help...

I have created a "Code Drop Down (Single Select)" field. It is supposed to display a select input element showing the last 120 years. The user should select a single year. It displays the data correctly. However, it does NOT save the selected value. What am I missing?

Following is the code, which I entered in (Parameters -> Code):

$current_year = date('Y');
for ($i=0; $i<121; $i++)
{
$year = $current_year-$i;
$year_array[$year] = "$year";
}
return $year_array;

Based on Kyle's suggestion, I replaced the above code with the following simple statement. This did not work either. Whatever I enter, it saves (1).
return array( 1, 2, 3, 4 );

Information on accessing a dev environment where you can see this error was sent to Kyle earlier. Following is the messages URL/ID.
www.joomlapolis.com/my-messages?task=show&messageid=804453

The problem field is (cb_arrival_to_australia), which is displayed on the page (newaussie.com.au/dev/index.php/cb-profile-edit) as (Arrival to Australia).

If you fix the error in the above environment, please let me know what you changed. This environment is made only for you to see the problem. I need to implement the fix in my dev/test & prod.

Please Log in to join the conversation.

6 years 11 months ago - 6 years 11 months ago #293541 by krileon
Replied by krileon on topic CB Code Field not Saving
Was able to confirm your issue. It's due to a strict in_array usage that shouldn't be strict. Fixing for new nightly build. Bug seams to also be in CB Query Field. As long as you're using string values you won't see this issue. Basically it only affects integer based options usages.

forge.joomlapolis.com/issues/6603


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.

6 years 11 months ago #293609 by bilal.abdeen
Replied by bilal.abdeen on topic CB Code Field not Saving
Kyle,

Thank you very much for the quick response.

I have been watching the download page (www.joomlapolis.com/downloads) for the "new nightly build". I can only see the one dated 22-April-2017. Am I looking at the right place?

By the way, for my current requirements, I actually prefer to store the values as strings. However, this seems to have a problem too. The following code didn't work.

return array( "1", "2", "3", "4" );

Please Log in to join the conversation.

6 years 11 months ago #293626 by krileon
Replied by krileon on topic CB Code Field not Saving
Nightlies for both CB Code Fields and CB Query Field were released with this fixed. They're build dated 2017.04.27. I can see them fine on our download page and under latest releases on home page.


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.

6 years 11 months ago #293648 by bilal.abdeen
Replied by bilal.abdeen on topic CB Code Field not Saving
I am very sorry, Kyle.
You are right. I was looking at the CB Package, rather than the CB Code Field!
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.209 seconds

Facebook Twitter LinkedIn