Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fixing date/time input for Arabic broke something #3528

Closed
benface opened this issue Dec 6, 2018 · 6 comments
Closed

Fixing date/time input for Arabic broke something #3528

benface opened this issue Dec 6, 2018 · 6 comments

Comments

@benface
Copy link
Contributor

benface commented Dec 6, 2018

Description

Sorry, I couldn't come up with a better title because I'm not exactly sure what's going on, but I found that this commit causes the following issue. Maybe it is setup-dependent, so note that I'm using MAMP PRO 5.2 on macOS 10.14.2.

Steps to reproduce

  1. Entries > New Entry (any section, as long as there's a title field)
  2. Leave the title blank and try to save
  3. When the page reloads to highlight the required title field, notice the "Post Date" field is set to the wrong date. For me, there's an extra 5 hours. Note: if we had filled the title field instead of leaving it blank and the page hadn't reloaded, and we then returned to the entry's page, the "Post Date" would be correct, strangely.

Additional info

  • Craft version: 3.0.34
  • PHP version: 7.2.10
  • Database driver & version: MySQL 5.7.23
@brandonkelly
Copy link
Member

What is your Timezone set to in Settings > General? Does changing it affect the behavior?

@benface
Copy link
Contributor Author

benface commented Dec 10, 2018

@brandonkelly It's set to America/New_York (I am based in Montreal, Canada, so it's the same timezone). And yes, it does seem to affect the behavior. If I change it to UTC, then there is no difference between the value that is pre-filled in the field when there's an error, and the value that is saved when there is no error. So basically the "extra 5 hours" I mention in the issue ^ is the difference from UTC. I tried with UTC-3, and there was a 3 hour difference when the page refreshed due to a validation error.

@brandonkelly
Copy link
Member

Unfortunately I’m not able to reproduce this. Whether the timezone is set to UTC, America/New_York, or America/Los_Angeles (my timezone), the selected Post Date is retained when saving a new entry, whether or not there are validation errors.

Do you have any plugins installed, or is there anything unique about your environment you can think of?

@benface
Copy link
Contributor Author

benface commented Dec 10, 2018

@brandonkelly Nothing I can think of. I was able to reproduce on a different environment just now (on an actual server running PHP 7.1). Maybe the repro steps aren't clear enough, so here's a video of the issue: https://www.youtube.com/watch?v=AxzX34nwYNY

@benface
Copy link
Contributor Author

benface commented Dec 10, 2018

Plugins installed are:

  • Element API 2.5.4
  • Preparse Field v1.0.3
  • Redactor 2.1.6

There's also a custom module but the issue occurs even if I disable it.

@brandonkelly
Copy link
Member

Ahhh, that clears it up, thanks. I didn’t realize you were leaving the Post Date field blank and letting it get autogenerated by Craft. Fixed for tomorrow’s release.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants