• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Date element not editable doesn't get the default value

troester

Well-Known Member
Staff member
After this
fixed: non-editable date, on new record with failed validaiton would prefill with todays date
Author: pollen8 <rob@pollen-8.co.uk> 2013-06-11 14:58:48

the default value (set in default or "always default to current") isn't shown in the new form if date element is not editable (form view = nobody)

Example on MySite (Test2 list)

Edit: the date is saved correctly and shown if record is edited, it's only not displayed in the new form
 
I confirm the same behavior in Fabrik 3.1: if date is not editable (access level to "nobody"), no default date is shown on the form, while the correct date is displayed if the access level is set to "public".

Tested on GitHub 867.
 
Hmmm. Well the change made in that commit ...

https://github.com/Fabrik/fabrik/commit/dd14bf999426af89f59a4fafb86bc63b663815e2

... was:

PHP:
        // If new record and element not editable - dont prefill with todays date: http://fabrikar.com/forums/index.php?threads/date-field-set-to-today-after-validation-failed.34078/
        if (!$this->isEditable() && $input->getInt('rowid') == 0)
        {
          return '';
        }

.... which would indeed have the effect you describe. I'm not entirely sure why Rob made this change, although according to the commit comment, it's something to do with validation failures.

I'll have to check with Rob, see what the deal is there.

-- hugh
 
ok can we update and test this one, I've had to pretty much rewrite the date element as it was a tangled mess
 
At least this issue is ok now;)
Tested editable/non-editable date element with default value (<>current), local time and validation errors.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top