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

[4.0]Calendar Today: Items wrongly set to pending #17770

Closed
infograf768 opened this issue Aug 30, 2017 · 27 comments
Closed

[4.0]Calendar Today: Items wrongly set to pending #17770

infograf768 opened this issue Aug 30, 2017 · 27 comments

Comments

@infograf768
Copy link
Member

infograf768 commented Aug 30, 2017

See #17709 (comment)

Items are set to pending.

user_utc

@brianteeman
Copy link
Contributor

this is the one i was thinking of #14860

@infograf768 infograf768 changed the title Calendar Today: Items wrongly set to pending Release Blocker ? => Calendar Today: Items wrongly set to pending Aug 30, 2017
@infograf768
Copy link
Member Author

#14860 is unrelated to this bug.
It deals with the tip set or not to user tz.
It does not point to this important issue which is that the item should not be set to pending when using Today after clearing the field, even if the time is in my example changed to local PC time instead of UTC.

@brianteeman
Copy link
Contributor

is this a change in behaviour? if so when did this change happen?

@infograf768
Copy link
Member Author

TBH, I don't know.

@brianteeman
Copy link
Contributor

thats the key. if it has always been this way then i would say its not a problem. if it has not then we need to find out what made the change instead of writing new code to patch over with a bandaid

@infograf768
Copy link
Member Author

Whether it is new or not (Which would mean no one noticed it until now, rather weird...), it is a real problem and has to be solved. I will wait to see what happens with this article wrongly set to pending when the new time (2017-08-30 10:31:10) = UTC.

@brianteeman
Copy link
Contributor

You are missing my point. If it is a new problem then we must look to see where and what caused this problem to appear BEFORE trying to create a fix. Who knows what other issues were created by that code. We have to stop writing code to fix things without looking to see what broke them in the first place. Thats how you end up with spaghetti code that makes no sense and creates problems in the long run.

If it has always been this way then after x years with no reports I would say it is not a problem

@alikon
Copy link
Contributor

alikon commented Aug 30, 2017 via email

@infograf768
Copy link
Member Author

infograf768 commented Aug 30, 2017

@dgt41
I have the feeling this is due to the new calendar. Can you check?

Will test on the last 3.6.x

@infograf768
Copy link
Member Author

Same issue in 3.6.5. Can't believe this. The bug has been there for ages... The calendar always picks the local time when choosing today. It does not take into account the global config setting at all.

@brianteeman
Copy link
Contributor

is it a bug then?

@infograf768
Copy link
Member Author

If I set the calendar fields to use filter="server_utc" instead of filter="user_utc"
It solves the issue here.

@infograf768
Copy link
Member Author

Yes, I think it is a bug.

@brianteeman
Copy link
Contributor

filter=user_utc has been there since at least 2010

@mbabker mbabker changed the title Release Blocker ? => Calendar Today: Items wrongly set to pending Calendar Today: Items wrongly set to pending Aug 30, 2017
@dgrammatiko
Copy link
Contributor

@infograf768 @brianteeman that was the reason I proposed that the calendar field should sent and receive from the front end only UTC datetime but that was a hard B/C break (?) as many people commented back then.
Anyways we should definitely do that for J4, in the mean time I don't think that this is easily patchable (by the way is server side code not js, check the data in the controller)

@infograf768
Copy link
Member Author

Just tested on a 2.5.28 and it does works fine. The time displayed corresponds to the user_utc and the item is not set as pending.

@dgrammatiko
Copy link
Contributor

@infograf768 i think 3.x has some extra code for the user_utc compared to 2.x.
I think it's these lines:

$this->value = strftime($this->format, strtotime($this->value));
date_default_timezone_set($tz);

We always read the input as UTC and convert it to server or user but the user submitted the date with their local timezone (most of the times the browser will have the timezone to the area that the user is living). There is the inconsistency...

@dgrammatiko
Copy link
Contributor

@infograf768 this should run only when the code is coming from the db, for the data that comes from a form input we need to convert it to UTC. That will fix the problem

@infograf768
Copy link
Member Author

@dgt41
patch welcome as thsi is very ennoying.
I guess that code has been tested in winter when GB is pure UTC for local users too 😃

@dgrammatiko
Copy link
Contributor

@infograf768 unfortunately I have no clue how to distinguish if the value comes from the form or the db at that point of execution, any ideas are welcome

@infograf768
Copy link
Member Author

tested a pre-PR by @dgt41 which solves the issue here.

@joomla-cms-bot
Copy link

Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/17770

@ghost
Copy link

ghost commented Sep 1, 2017

closed as having Pull Request #17823


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17770.

@mbabker
Copy link
Contributor

mbabker commented Sep 27, 2017

Re-opened. PR had side effects and was reverted.

@brianteeman
Copy link
Contributor

2 years later and I guess either this has been fixed or no one sees it as a bug worth fixing

@dgrammatiko
Copy link
Contributor

dgrammatiko commented Jan 4, 2020

@brianteeman it will worth the effort if someone could implement [edit] for J4 [/edit] my suggestion in my first comment:
that was the reason I proposed that the calendar field should sent and receive from the front end only UTC datetime

@joomla-cms-bot joomla-cms-bot changed the title Calendar Today: Items wrongly set to pending [4.0]Calendar Today: Items wrongly set to pending Mar 11, 2020
@brianteeman
Copy link
Contributor

As we are now in rc and code freeze I am assuming that this is not going to be addressed.

There is no point in keeping issues open if they are not accepted

@chmst chmst closed this as completed May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants