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!
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?
Labels |
Added:
?
|
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.
@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.
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?
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.
I can confirm this behaviour reported by @marcochirienti . Not sure if it is an issue though
Category | ⇒ | com_content |
@marcochirienti can you make an Issue-Report?
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-04-04 16:36:10 |
Closed_By | ⇒ | franz-wohlkoenig |
Status | Closed | ⇒ | New |
Status | New | ⇒ | Closed |
Closed_Date | 2017-04-04 16:36:10 | ⇒ | 2017-04-04 16:36:11 |
Closed_By | franz-wohlkoenig | ⇒ | joomla-cms-bot |
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/14260
closed Issue because Discussion seems ended. Please reopen if needed.
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..