[#5697] CB 2.0.12 - conflict between value an validation rule of an integer field

8 years 3 months ago - 8 years 3 months ago #275969 by erichburkhard
I have installed the newest Joomla version and upgraded from CB 2.0.11 to 2.0.12. I have the following issue now:

1. I implemented an integer field called 'cb_size'. The field value is not required. The validation rules behind this field are as follows:



2. I change into the 'Profile Edit' mode of my website. A default value '0' is visible now in this field. If I try to update the profile form with this (unchanged) value '0' the following warning will be displayed:



3. I delete the '0' from this filed. Now its possible to save the form...

4. I change again into the 'Proifle edit' mode of my website. The '0' (which I deleted in step 3) is visible again...and again I have to delete this '0'...otherwise it is not possible to save the form

...Any idea? ...I didn't have this 'behaviour' under 2.0.11

regards
Attachments:

Please Log in to join the conversation.

8 years 3 months ago - 8 years 3 months ago #275994 by krileon
The validation code didn't change for that usage in 2.0.12. We only fixed REGEXP validation issues. This probably has been around forever because it's the minimum valued allowed validation in JS that's triggering it and has been unchanged for a very long time. It sees 0 as a value instead of being empty and runs it against the validation, which fails because you have a minimum of 100 set.

Have added a bug ticket to see if the JS validation rules can somehow account for this when integer or digit validation rule is in use.

forge.joomlapolis.com/issues/5697


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: nant

Please Log in to join the conversation.

8 years 2 months ago - 8 years 2 months ago #277433 by erichburkhard
Hi Kyle - from my point of view, the issue forge.joomlapolis.com/issues/5697 is not solved yet (I have installed CB 2.0.13 - in this rel. the issue should be fixed). The test scenario I have executed are as follows:

prerequisite: Non mandatory integer filed without any validation rule
testcase 1: value '0' in profile edit will result in value '0' in profile view -> OK
testcase 2: value '' (no entry) in profile edit will result in value '-' in profile view -> OK
testcase 3: value 10 in profile edit will result in value '10' in profile view -> OK

...now I added 1 validation rules to this field...e.g 'minimum value is 10...

testcase 4: value '' (no entry) in profile edit will result in value '0' in profile view -> NOK

So testcase 4 is NOK because of the validation rule. But even if I remove the validation rule from the field testcase 4 is still NOK, so the field 'infrastructure' seems to be damaged

reagards

Please Log in to join the conversation.

8 years 2 months ago - 8 years 2 months ago #277442 by krileon

testcase 4: value '' (no entry) in profile edit will result in value '0' in profile view -> NOK

5697 is a validation bug and is fixed. This is an entirely different issue. It's likely this won't be fixed until we refactor our storage code to handle null stores. The below should workaround the issue using Profile View Value Layout though.

[cb:if FIELD_NAME>"0"][value][/cb:if]

The above should cause 0 values to output as empty resulting in a display of -.

The fix implemented for 5697 is basically a workaround until storage behavior has been refactored to allow us to store null values when needed, which solves the issue entirely (meaning even in database it'd store null properly instead of always at least 0).

forge.joomlapolis.com/issues/5766


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.

Moderators: beatnantkrileon
Time to create page: 0.189 seconds

Facebook Twitter LinkedIn