Plugin timestamp updates the date even when the function is disabled

I think the timestamp element creates a DB column type timestamp. The update is done directly by MySql not via Fabrik. Fabrik is only doing the display.

Gesendet von meinem GT-I9300 mit Tapatalk
 
Well, Troester is correct in that we shouldn't supply any values, and the timestamp field should behave according to the "Update on edit" setting, which controls whether the field declaration includes ON UPDATE CURRENT_TIMESTAMP or not.

The problem was that since we wrote that plugin, we'd added the "new" generic "Store in DB" setting (under the Access settings) for all elements, which had a side effect of overriding the timestamp element's decision about whether to provide a value when saving. So if that "new" setting was left set to Yes, we would erroneously provide a value for the timestamp when saving the record (and thus overriding MySQL's default update behaviour).

I've added an override in the timestamp element so it always returns false for recordInDatabase(), regardless of the "Store in DB" setting.

https://github.com/Fabrik/fabrik/commit/4ec6c887c056d75d312c36ff4a84a0acb2f30640

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top