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
|Category||⇒||Administration com_content Front End|
I have not tested this item.
We have follow the steps and it work correctly before apply the patch
We think this way is correct
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.
@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');
('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. ;)
@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.
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. ;)
|Status||Pending||⇒||Ready to Commit|