1. Fabrik 3.8.1 has been released. It is mostly bug fixes and feature enhancements, but does include two new plugins (push notifications, and the sequence element). As usual we strongly recommend testing the new release on a sandbox if your application is mission critical, and always do an Akeeba backup before updating.
    Dismiss Notice

Time Element storing "hours" in "seconds"

Discussion in 'Professional Support' started by bggann, Sep 13, 2018 at 10:08 PM.

  1. bggann

    bggann Member

    Level: Professional
    I'm using the time plugin (field) extensively in my aviation forms - and sometimes (intermittent) it stores the "hours" as "seconds" in the database. This seems to only happen on one form/group/field.
    This plugin stores time as a string "hh:mm:ss" and in the failed cases it is storing "00:00:hh"

    In all cases, I'm setting the format for list and for details as 'hh:mm' meaning I do not enter or record seconds.
    Recording to 15 minute increment
    Separator ":"
    24 hr dropdown
    Enhance Dropdown no
    All other things are default.

    In one case, it seems to be working fine.
    In a second case (same element, but in different group and NOT child) it is, sometimes, recording the "hours" as "seconds" in the database.
    I'm calculating (ajax and on save) the number of hours between times - and that is correct, so at AJAX and on save, they are correct. Otherwise I could not calculate based on them. But, if you look at the database (php admin), the data is stored correctly.

    For example:
    Start time: "10:00:00"
    Stop time: "00:00:00" <- midnight
    Hours: 14 <- correct, 10am to midnight is 14 hours.

    In the database is stored
    Start Time: "00:00:10"
    Stop Time: "00:00:00"
    Hours: 14

    Note - the hours in the database is correct. So the calculation I do for hours is working - which means the data I get from the placeholders is correct. (I parse the string).

    This is working on one instance of the time plugin, but not the other (in a different group).
    The names of the working are the same, but they are not parent/child.


Share This Page