User tests: Successful: Unsuccessful:
Pull Request for Issue #32117.
This PR improves frontend article submission form so that the form will respect permission of the pre-selected category (which is selected in the menu item parameter). See #32117 to understand the issue better
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_content Front End |
Labels |
Added:
?
|
Hello @Razzo1987
Maybe my testing instructions is not clear. Please give Author user group edit state permission for the category, then access to create article form:
Hope it is clear now.
I have tested this item
I have tested this item
Please resolve conflicts
@infograf768 Done !
@infograf768 I don't understand how workflow works yet, so I'm unsure about it. However, from what we can see in the code (even before this PR), if someone has edit state permission, he should be allowed to change start publishing..., see the code block here https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_content/src/Model/ArticleModel.php#L533
So this PR is fine.
In the original code you quote, we have
|| ($id == 0 && !$user->authorise('core.edit.state', 'com_content')))
[...]
$form->setFieldAttribute('state', 'disabled', 'true');
But ('core.edit.state', 'com_content')
is a general Option for com_content and its default is Not Allowed
for Author:
Therefore, we can't expect the Author to be able to Publish the new article, as stated in the PR description.
After patch: You can select status for the article (for example Published), select date For Start Publishing, Start Featured.. (in Publish tab)
Thus why I was posting my comment. :)
Please modify description and confirm the PR only deals with Start Featured, Finish Featured, Start Publishing, Finish Publishing
fields and I will test it OK as only Publisher can publish. ;)
@bembelimen Any input here?
@infograf768 Start Featured, Finish Featured, Start Publishing, Finish Publishing is treated the same with Status. The Author does not have edit state permission by default in com_content, however, he is submitting article to a Category which Author user group has Edit State Permission set to Allowed and that's the reason he can modify these data (Start Featured, Finish Featured, Start Publishing, Finish Publishing)
To be more clear, all this PR does is change the logic of Edit State Permission check from this block of code https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_content/src/Model/ArticleModel.php#L533
When submit article, the permission should be inherited from the pre-selected category (in the menu item setup), not inherit permission directly from com_content. If it is needed, you can read the issue description #32117 to understand the real issue this PR solves it.
Ok, I think I understood the confusion.
ref: #32117
That issue defines a problem when Workflow is NOT implemented.
That is THE important aspect to know.
In that case, we have a Status field (and not Workflow), readonly, and set to Published by default and your PR makes sense.
Please modify description. ;)
@infograf768 I'm unsure what I need to modify to the PR description? I haven't use nor understand how workflow works, so I don't know what I have to write there.
I have tested this item
Tested successfully in Beta8-dev in Wampserver 3.2.4 using Apache 2.4.46c, MySQL 8.0.23 and PHP 8.0.2.
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
Rtc
Note that the Status field with Published as default will only display when workflow is off.
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-03-10 10:12:32 |
Closed_By | ⇒ | rdeutz |
I have not tested this item.
We have follow the steps and it work correctly before apply the patch
User as Author:



Category with permission:
Article create as unpublished:
If the user is Publisher:


He can change the article statement:
We think this way is correct
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32468.