?
avatar schnuti
schnuti
26 Feb 2017

You can save existing articles without creation date (nulldate = 0000-00-00 00:00:00) in the db. Joomla 3.6.5 and 3.7.0

In 3.6.5 and 3.7.0 you remove the existing date from the input field and save. In 3.7.0 you can also enter an invalid date and save, this since PR #13974. An invalid date was blocked by an error in 3.6.5 in 3.7.0 you get an error message but the article is still saved!

Expected result

I expect that all saved articles must have a creation date. I have more to say about the new calendar field but the creation date without required="true" is a special case.

Should a nulldate for an existing article generate a now date or an error message and return to the form?

avatar schnuti schnuti - open - 26 Feb 2017
avatar joomla-cms-bot joomla-cms-bot - change - 26 Feb 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 26 Feb 2017
avatar schnuti schnuti - edited - 26 Feb 2017
avatar yvesh
yvesh - comment - 26 Feb 2017

Personally i think it's okay to generate a now datetime instead of inserting null if the field is empty. But this field, which is for many people not important, should not prevent a form from saving..

avatar Bakual
Bakual - comment - 26 Feb 2017

Imho, you need to explicitely produce an error condition so you end up with a null date, right?
By default, current date is already used if nothing else is set. So if I am nor mistaken I think it is fine as is.

avatar schnuti
schnuti - comment - 26 Feb 2017

@Bakual
You are wrong. Current date and time is only taken for new articles without entered date. Not after editing. You do not need an error. You can empty the field.
Easiest would be to use current date and time also for edited articles without data in the created field. Another idea would be to use the original value if the posted date is empty. i.e. not change it.

I'll add another issue for the general calendar field problem.

avatar Bakual
Bakual - comment - 27 Feb 2017

Current date and time is only taken for new articles without entered date.

That's where the article is created and where it makes sense to auto-populate it.

Not after editing.

Obviously not, because it's not the created date by that time.

You can empty the field. With the new pop-up - click on clear and "save and close"

Yes sure, if the user decides he wants for some reason delete that date, why should he not? I don't see an issue with that. It's not like the created date is necessary for proper function of the component.

Easiest would be to use current date and time also for edited articles without data in the created field.

That would be a wrong date for the created field. We already save the date of the last edit in the modified field.

Another idea would be to use the original value if the posted date is empty. i.e. not change it.

That would mean to first do a query and look up the existing article prior to saving it. Otherwise it doesn't work.

I don't really get the issue you have. If someone wants to store a null date for whatever reason, why should we prevent it?

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 2 Mar 2017

@schnuti do you wan't to close this Issue?

avatar marcochirienti
marcochirienti - comment - 22 Mar 2017

This is also true for the creator user id.

  • Create a new article and save it. If the created_by field has not been set by the user, the store method of JTableContent sets the created_by field with the current user id and the created field with the current date.

  • Open the article, select the Publishing tab, click on the created by field to select a user and press the no user button in the modal user picker.

  • Save the article. The store method of JTableContent sets the modified time and ignores the created_by and created fields, alowing the user to save an article without author.

avatar joomla-cms-bot joomla-cms-bot - change - 22 Mar 2017
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 22 Mar 2017
avatar brianteeman
brianteeman - comment - 22 Mar 2017

I can confirm this behaviour reported by @marcochirienti . Not sure if it is an issue though

avatar franz-wohlkoenig franz-wohlkoenig - change - 30 Mar 2017
Category com_content
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 4 Apr 2017

@marcochirienti can you make an Issue-Report?

avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Apr 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-04-04 16:36:10
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - change - 4 Apr 2017
The description was changed
Status Closed New
avatar joomla-cms-bot joomla-cms-bot - edited - 4 Apr 2017
avatar joomla-cms-bot joomla-cms-bot - change - 4 Apr 2017
Status New Closed
Closed_Date 2017-04-04 16:36:10 2017-04-04 16:36:11
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 4 Apr 2017
avatar joomla-cms-bot
joomla-cms-bot - comment - 4 Apr 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 4 Apr 2017

closed Issue because Discussion seems ended. Please reopen if needed.


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

Add a Comment

Login with GitHub to post a comment