As pointed out in issue #14260, in com_content is possible to save an article without the author Id.
I'm not sure if this is an issue, but I have been asked to reopen it, so here I am...
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.
Reopen 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 user but ignores the created_by and created fields, allowing the user to save an article without author.
The article should keep the author id.
The article is stored with null author id.
Joomla 3.7
Other components share the same behavior (e.g. com_categories and com_tags).
Labels |
Added:
?
|
Category | ⇒ | com_content |
Priority | Medium | ⇒ | Low |
It's is just an informational field. Nothing is broken if you don't select a user there. So imho is working as expected.
It's fine for me, it shouldn't be a problem. As I said, I reopened a separate issue just because I have been asked to do it...
Status | New | ⇒ | Expected Behaviour |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-04-05 11:55:57 |
Closed_By | ⇒ | franz-wohlkoenig |
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/15101
close as Expected Behaviour.
It may be expected but that doesn't necessarily make it right. IMO we really need to review our data model and ensure our PHP code matches the data schema and the data schema has sensible configurations (like fields which are supposed to be foreign keys should not have a DEFAULT 0
type statement).
Created by isn't just informational. It can have ACL implications.
Priority | Low | ⇒ | Medium |
Status | Expected Behaviour | ⇒ | Needs Review |
Closed_Date | 2017-04-05 11:55:57 | ⇒ | |
Closed_By | franz-wohlkoenig | ⇒ |
Set to "open" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/15101
reopened as "Needs Review" in Issue Tracker.
If you remove the ability to set the author to none (and.i get the logic) you also have to address what to do when a user is deleted from a site and they are an author. The same logic/acl issue applies to both cases.
Created and modified are fine as nullable fields IMO. It just needs to be better communicated what this means and the code should actually null the field instead of using a 0 value (if proper foreign keys were used, the insert/update queries would fail with that because there isn't a 0 foreign key to the users table).
IMO they are related problems, but not exactly the same thing. I don't see any benefits of allowing the user to save an article without author. So first of all the user should not be able to set the author id to none.
To handle orphan items maybe a solution could be to develop a functionality, available only to Super Users, to batch change the author ID only on orphan items.
I don't see any benefits of allowing the user to save an article without author.
There is also no benefit in enforcing an author since technically it is not needed. So to each their own.
Plus we don't need special code for when users are deleted, which by itself is a benefit.
Of course @mbabker is right that it should be a "NULL" value instead of 0. But for some (unknown to me) reason in Joomla land coders think all fields should be defined as "NOT NULL".
Can Maintainers decide how to go on with this Issue?
Also besides the case of
that will need to be handled
There is the case of
ACL can allow the above
guest users have ACL core.create and submit via a form with captcha
but do not have ACL core.edit.state to publish the content
Actually I like the option to have "no user" as the author. This allows me to have all "public service" content from a site to be out of the user profiles (e.g. if you use community builder and you have an overview of articles from an author). For me, this is a feature that I have come to appreciate.
I've filed a separate bug for not being able to filter on "no author" though: https://issues.joomla.org/tracker/joomla-cms/18434
Labels |
Added:
J3 Issue
|
If I understand it right, the open question is to have NULL instead of 0 when selecting "no user" as author. It is something that can / should be solved? If not for J3 maybe for J4? Or is a "won't fix"?
set label:"Information Required"
Labels |
Added:
Information Required
|
for me a won't fix....cause we don't have foregin key yet
Thank you for raising this issue.
Joomla 3 is now in security only mode with no further bug fixes or new features.
As this issue doesn't relate to Joomla 4 it will now been closed.
If we are mistaken and this does apply to Joomla 4 please open a new issue (and reference this one if you wish) with updated details for testing in Joomla 4.
cc @zero-24
Status | Needs Review | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-08-23 13:49:36 |
Closed_By | ⇒ | zero-24 | |
Labels |
Added:
No Code Attached Yet
Removed: ? |
Isn't. This the same as when the user who created the item is removed from the web site?