Date element rewinds 6 hours on validation fail - github 12/1/16

nbradshaw

Active Member
I have a date element with time enabled. I have eval enabled to show current day with time of 00:01.

When I save the form without filling in the required fields - the time will rewind 6 hours.

I have the time set to Local Time.

Please see attachments.
 

Attachments

  • val4.JPG
    val4.JPG
    52.2 KB · Views: 183
  • val3.JPG
    val3.JPG
    53.1 KB · Views: 171
  • val2.JPG
    val2.JPG
    86.1 KB · Views: 173
  • val1.JPG
    val1.JPG
    69.5 KB · Views: 171
OK, try this ... in ./plugins/fabrik_element/date/date.js, around line 426, in shouldApplyTZ(), change ...

Code:
            if ($newRecord)
            {
                //if (($alwaysToday || $defaultToday) || $formModel->hasErrors())
                if (($alwaysToday || $defaultToday))
                {
                    // User supplied defaults should be in GMT, they are only applied if no other default found.
                    return true;
                }
            }

... so comment out the existing test, and try without the $formModel->hasError().

-- hugh
 
Yup, this commit fixes the cron last run issue.

Although it's still showing UTC in list view (e.g. 18:01) and local time in edit view (20:01), but this time is fix, not modified on save anymore.
 
Ok - I updated github today - and I still am experiencing this. I also changed the element to UTC - and still rewinds 6-hours. I am Central Time - so I am -6 from GMT.
 
Ok - I updated github today - and I still am experiencing this. I also changed the element to UTC - and still rewinds 6-hours. I am Central Time - so I am -6 from GMT.

That's because I haven't made any changes to the date element, as you never got back to me:

OK, try this ...

... by which I meant try the fix I suggested, let me know.


That commit I made was just for the cron issue @troester mentioned.

-- hugh
 
ah - ok...I thought the commit would cover it. I am attaching my date.js file from the github from today...I am having trouble finding the text that you are mentioning. I changed the filename from .js to .txt for the upload.
 

Attachments

  • date.txt
    32.8 KB · Views: 190
Ok - I made changes to date.php...and unfortunately - it is still rewinding 6 hours. Any other thoughts?

PHP:
if ($newRecord)
425                         {
426                                 //if (($alwaysToday || $defaultToday) || $formModel->hasErrors())
427                                 if (($alwaysToday || $defaultToday))
428                 {
429                                         // User supplied defaults should be in GMT, they are only applied if no other default found.
430                                         return true;
431                                 }
432                         }
 
Not off the top of my head. And I'm on an Interstate somewhere near Savannah, Georgia atm. I'm on the road, visiting family. I'll take a look once I'm at a computer again, which will probably be tomorrow.

Sent from my HTC 10 using Tapatalk
 
Hi Hugh - hope you enjoyed a little time off. Are you able to duplicate this in your environment? What type of logs/troubleshooting can I provide you to try and nail this down?
 
ok - so just to confirm - you were able to duplicate it before the fix in date.php?

I am on a private server...I am going to look into getting you vpn credentials.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top