Bug: Repeating group element default failing

I have a database join element which renders as a drop box in a repeatable group. Its an integer joining to the id of the another table. All works just fine, including the default value, but...
If the element is not editable by the current user, the default value does not get stored with the record, a zero does.
In fact I've tried to get around this by writing a "Replace value" validation, but it still gets overwritten with zero.
 
@fred04 - sounds like different issues. I'll try and get round to your today.

@jr - looking at the default issue now.

-- hugh
 
@jr - I don't seem to be able to duplicate this.

I seem to recall I added a fix recently which may be related. Can you make sure you are running the latest from github?

-- hugh
 
Hugh, thanks for looking at this.

I've just updated from GitHub but seeing the same behavior.
BTW, with a dropdown, do you know if the default value should be the value or the label value? I've tried both. In this context with the element not editable but viewable, the value renders as the value (1 for instance) and not the equivalent label value.

Another point, this value is also lost if a validation fails on a different element and the user is returned to the form.

My site is now available if you want to have a look.
 
I'm talking about the main default box and I had that wrong... it does render as the label value.
Looking at your Jing, I see Alabama is the first in the list. Have you tried with a different state?
I'll get a Jing video done soon.
 
I tested with several random state keys, and they all work.

However, I did notice one potential gotcha. Can you check the "Save partially completed multi-page forms" setting for your form (under Form Processing options), and make sure it is set to No.

If it was set to anything other than No (and probably even if it was set to No, just as a precaution), fire up phpMyAdmin (or whatever) and check to see if you have any entries in your #__fabrik_form_sessions table, specifically ones with the form_id you are working with. If so, zap those rows.

Let me know if that makes any difference.

-- hugh
 
Hi Hugh,

I've deleted the data in __fabrik_form_sessions, and the form is not set to save partially completed multi-page forms. Still no good.

I've tried heaps of different things to get this to save as something other than zero. This one surprises me:
If I have a php validation, code: "return 1;" and its set to "Replace", it still saves as zero.
 
OK, I've got this working now.

The default value was not being saved when the user did not belong to the element's "edit" access group. I'm not sure if call this a feature or not :)

Later that day...

Well its still not right. Doing the above does in fact make the dropdown editable by a public user. I thought having "view" access denied was hiding the element, but no.

So to recap, I'm trying to get the element to work like this:

  • Its a dbjoin rendered as a dropdown
  • Part of a repeatable group
  • Default value to save as 1
  • Not editable and preferably not viewable by public
  • Editable for chosen group
However, the only way I can get the default of 1 to save, when the user is public, is to make the element editable by public. :(
 
Update: This has been fixed, but still has an issue I reckon.

The default does now gets saved but the issue is in the timing. It seems that the default value is being set after the form plugins run. So I'm sending off an email and the element's value is empty when the email goes out, but correct when the processing has finished.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top