Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Calender events with comma are sometimes truncated and sometimes can't be created #7359

Closed
m4z opened this issue Feb 27, 2022 · 3 comments · Fixed by #7336
Closed

Calender events with comma are sometimes truncated and sometimes can't be created #7359

m4z opened this issue Feb 27, 2022 · 3 comments · Fixed by #7336
Labels
Milestone

Comments

@m4z
Copy link

m4z commented Feb 27, 2022

Description

Sorry if this is a duplicate, but I couldn't find an existing issue when searching for some/all of "event date comma". I myself can't replicate that part of the issue—event dates with comma can be created fine-ish (read on) on my forum; I don't know what causes the error.

Event creation error reported here:

However, while testing this, I noticed the date strings are sometimes butchered, see below. (Maybe these are two separate issues and we should split them, but for now I suspect they are related.)

In the second, slightly older, forum with the german time_format, the dates are butchered and displayed as "%a.%d.%m.%Y, %H:%M" ("So.27.02.2022, 11:31 […] CET") instead of "%a., %d.%m.%Y, %H:%M" ("So., 27.02.2022, 11:31 […] CET"). For some reason, this doesn't happen in the nightly version forum with the default time_format ("Feb 27, 2022, 10:50 VORMITTAG […] CET").

Same thing with whole-day events:

  • alpha: "So.27.02.2022" (butchered)
  • nightly: "Feb 27, 2022" (fine, AFAICT)

In general, I get the feeling that time_format is used for both displaying dates in the forum (this is what the docs say), and programmatically working with the date, at least in the calendar context. I think this is a bad idea, for example I can imagine people even including static strings in the format string, like "year of the lord"-type stuff for religious forums, or "stardate" for other religions.

Steps to reproduce

  1. Create an event
  2. Notice the begin and/or end dates contain a comma (depending on time_format)
  3. (Also notice the date strings are sometimes butchered (some commas and some spaces—apparently only in the date portion, not the time portion—have been removed))
  4. Try to post the event
  5. Some (users in some) forums will see an error, others won't.

Environment (complete as necessary)

  • Version/Git revision:
    • forum 1 ("nightly"): recent nightly tarball (2a2cac7(?)) with time_format "%b %d, %Y, %I:%M %p" (which might be the default),
    • forum 2 ("alpha", on the same server): 686a12c, with non-default time_format "%a., %d.%m.%Y, %H:%M"
  • Database Type: postgres
  • Database Version: 9.6.something / any
  • PHP Version: 7.0

Additional information/references

I don't think my locale plays a role in this:

$ locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
@Sesquipedalian
Copy link
Member

The two most recent commits to #7336 should fix these issues:
9957ead should fix the mangled date strings when using multiple punctuation marks in a row.
4b17fcb works around the comma problem, which appears to be a bug in PHP's date_parse() function.

Please test to confirm that it works for you.

@Sesquipedalian Sesquipedalian added this to the 2.1.2 milestone Feb 28, 2022
@Sesquipedalian
Copy link
Member

Please test to confirm that #7336 fixes this issue.

@m4z
Copy link
Author

m4z commented Mar 4, 2022

Yep, looks good. Thanks!

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

Successfully merging a pull request may close this issue.

2 participants