No Code Attached Yet J3 Issue Information Required
avatar marcochirienti
marcochirienti
5 Apr 2017

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...

Steps to reproduce the issue

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.

Expected result

The article should keep the author id.

Actual result

The article is stored with null author id.

System information (as much as possible)

Joomla 3.7

Additional comments

Other components share the same behavior (e.g. com_categories and com_tags).

avatar marcochirienti marcochirienti - open - 5 Apr 2017
avatar joomla-cms-bot joomla-cms-bot - change - 5 Apr 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 5 Apr 2017
avatar marcochirienti marcochirienti - edited - 5 Apr 2017
avatar joomla-cms-bot joomla-cms-bot - change - 5 Apr 2017
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 5 Apr 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 5 Apr 2017
Category com_content
avatar franz-wohlkoenig franz-wohlkoenig - change - 5 Apr 2017
Priority Medium Low
avatar brianteeman
brianteeman - comment - 5 Apr 2017

Isn't. This the same as when the user who created the item is removed from the web site?

avatar Bakual
Bakual - comment - 5 Apr 2017

It's is just an informational field. Nothing is broken if you don't select a user there. So imho is working as expected.

avatar marcochirienti marcochirienti - change - 5 Apr 2017
The description was changed
avatar marcochirienti marcochirienti - edited - 5 Apr 2017
avatar marcochirienti
marcochirienti - comment - 5 Apr 2017

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...

avatar joomla-cms-bot joomla-cms-bot - close - 5 Apr 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 5 Apr 2017
Status New Expected Behaviour
Closed_Date 0000-00-00 00:00:00 2017-04-05 11:55:57
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - change - 5 Apr 2017
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 5 Apr 2017
avatar joomla-cms-bot joomla-cms-bot - close - 5 Apr 2017
avatar joomla-cms-bot
joomla-cms-bot - comment - 5 Apr 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 5 Apr 2017

close as Expected Behaviour.


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

avatar mbabker
mbabker - comment - 5 Apr 2017

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.

avatar joomla-cms-bot joomla-cms-bot - reopen - 5 Apr 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 5 Apr 2017
Priority Low Medium
Status Expected Behaviour Needs Review
Closed_Date 2017-04-05 11:55:57
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - change - 5 Apr 2017
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 5 Apr 2017
avatar joomla-cms-bot
joomla-cms-bot - comment - 5 Apr 2017
avatar joomla-cms-bot joomla-cms-bot - reopen - 5 Apr 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 5 Apr 2017

reopened as "Needs Review" in Issue Tracker.


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

avatar brianteeman
brianteeman - comment - 5 Apr 2017

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.

avatar mbabker
mbabker - comment - 5 Apr 2017

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).

avatar marcochirienti
marcochirienti - comment - 5 Apr 2017

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.

avatar Bakual
Bakual - comment - 5 Apr 2017

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".

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 29 May 2017

Can Maintainers decide how to go on with this Issue?


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

avatar ggppdk
ggppdk - comment - 29 May 2017

Also besides the case of

  • owning user is deleted

that will need to be handled

There is the case of

  • content submited by guest users (via help of 3rd party extension)

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

avatar JurgenG
JurgenG - comment - 28 Oct 2017

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


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

avatar brianteeman brianteeman - change - 25 Mar 2018
Labels Added: J3 Issue
avatar brianteeman brianteeman - labeled - 25 Mar 2018
avatar drmenzelit
drmenzelit - comment - 8 Dec 2020

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"?

avatar gostn
gostn - comment - 9 Dec 2020

set label:"Information Required"

avatar drmenzelit drmenzelit - change - 9 Dec 2020
Labels Added: Information Required
avatar drmenzelit drmenzelit - labeled - 9 Dec 2020
avatar alikon
alikon - comment - 8 Jan 2022

for me a won't fix....cause we don't have foregin key yet

avatar brianteeman
brianteeman - comment - 23 Aug 2022

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

avatar zero-24 zero-24 - change - 23 Aug 2022
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: ?
avatar zero-24 zero-24 - close - 23 Aug 2022

Add a Comment

Login with GitHub to post a comment