• 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.

Time Element storing "hours" in "seconds"

bggann

Active Member
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.

-Bob
 
Nope.

So from you description, it's not consistent? It does this "sometimes", not all the time?

-- hugh
Yes - unfortunately. It is intermittent.
Here is SQL query output from the database.
Note - availability_hours is a calculated field that is calculated from availability_start and availability_stop.
For a day where the availability runs from 10:00 to midnight, that is 14 hours. Since it is a calc field based on the start and stop - that tells me it was correct in the fields on submission.
Notice from the dates - that this has been happening for a while. most recent was 9/25 - as in today.
The only 'HINT' I have is that I never see this on Helicopters or SEATs, only the MMA aircraft type. The availability_start and _stop elements are parent/childs for the heli's and SEAT's, but independent elements for the MMA. All instances write to the same database columns.
But that may be a red herring because the Helicopters and SEATs can't be available from 10am to midnight (they don't fly after dark), so it may just be they are not being entered at from 10:00:00 to 00:00:00
upload_2018-9-25_14-52-51.png
 
Last edited:
I spent a while going through that code and testing various scenarios, but I cant yet see a condition that would cause that to happen.

I'll carry on trying. But as usual, I can only fix something if I can replicate it. If you can do some testing and see if there's any way you can replicate it, that'd help.

I thought I might have been on to something with a condition that occurs after a validation failure, where the value won't be an array, it'll be a string, but alas ... the code already accounts for that.

-- hugh
 
Yeah - I know. It is very frustrating. I'm wondering if it has to do with the 'midnight' nature - but it is the 10am one that is failing. I see it happening, but I can't come up with a particular sequence. I'll also look to see if it is a particular user. Didn't think of that one.

Bob
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top