JDate Element NULLs out in database when saved from an edit form if read only.

Status
Not open for further replies.

ghicar

Member
I have found a bug in Fabrik4(delta) for the JDate element used read only in a Fabrik form. The forms work fine in J!3 & Fabrik3.10. Apologies if this is reported already, but I could not see it searching manually in this forum.

If you have a list with a JDate element that is displayed read only in an edit form, then upon saving the row the JDate field is NULLED out in the database.
The JDate element is configured to display in "Y-m-d" format. And is made read only by setting Access:Form(edit) to "nobody".

This occurred in a more complex table structure with joined tables and several prefiltered lists onto the same tables but I isolated the problem down to the simple case described below.

I created a new List with a single jdate field. I added several rows to this table, and then switched the element's access to be editable by nobody (ie read only). On subsequent saves of rows the date field is nulled out in the database.
 
Confirmed.
Can you try to do plugins\fabrik_element\jdate\jdate.php line 32

class PlgFabrik_ElementJdate extends PlgFabrik_ElementList
 
PlgFabrik_ElementList was comment-out. Do we know why?
As the date plugin also extends from PlgFabrik_ElementList, jdate should probably be also. However jdate does not call anything in PlgFabrik_ElementList. PlgFabrik_ElementList extends from PlgFabrik_Element

One more thing to check: function getDefaultAttribs in PlgFabrik_Element is missing the defaults for jdate.
So you may need to add the same defaults for jdate as for date in that list.
 
Ah yes, that edit on jdate.php line 32, from "extends PlgFabrik_Element" to "extends PlgFabrik_ElementList" has fixed the issue reported in the simple test case and in the more complex cases where I found the issue.

Many thanks for the speedy response.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top