timestamp update on databasejoin change?

vivoices

New Member
I have a timestamp field set to "Update on edit" and show it in the List View as "Last Update".
The same List has a few databasejoin elements rendered as multi select dropdown.

When updating these databasejoin values, the timestamp is not updating itself,
probably because Fabrik stores these values in ..._repeat_... tables.

Is it possible to have the "Last Update" element set a new timestamp even when databasejoins are changed in ..._repeat_... tables?

Thanks,
Udo
 
I've encountered this issue before - and reported it. It seems that the timestamp element does not play well with certain other plugins.

IMO I don't even know why that plugin is still there - if it has 'issues'.

Try changing the element type to 'Date' and in the Formatting tab select 'Always return today's date' - Set as 'Hidden' in Options tab. It does the same thing.

Oops - tried that too. Here's the fix - disable the database joins - lol. (Excuse my sarcasm)

Obviously the database join element is causing a lot of problems lately - and it's not 'just me'.
 
When setting the databasejoin element to multiple choices as in "Checkbox" or "Multi select dropdown" (I wish it was an actual dropdown instead of a multi select list), Fabrik creates a new ... _repeat_ ... table, to keep the whole database normalized.
So in this example the topics choices of the `subscribers` table are stored in the `subscribers_repeat_topics` table.
The `last_updated` element in the `subscribers` table relies on a default column value of 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP' for updates.
That column default setting only updates on `subscribers` table updates.

So creating two triggers for each multiple choices databasejoin element fixes the problem:
Code:
CREATE TRIGGER
    `timestamp_topics_ins`
BEFORE INSERT ON
    `subscribers_repeat_topics`
FOR EACH ROW
BEGIN
    UPDATE
        `subscribers`
    SET
        `subscribers`.`last_updated` = NOW()
    WHERE
        `subscribers`.`id` = NEW.`parent_id`;
END
CREATE TRIGGER
    `timestamp_topics_del`
BEFORE DELETE ON
    `subscribers_repeat_topics`
FOR EACH ROW
BEGIN
    UPDATE
        `subscribers`
    SET
        `subscribers`.`last_updated` = NOW()
    WHERE
        `subscribers`.`id` = OLD.`parent_id`;
END

. . . but I hope someone will find the time to fix the databasejoin plugin.


Fabrik is a wonderful addition to Joomla!

Thanks a lot to everyone making it possible.
Udo
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top