? ? Maintainers Checked Pending

User tests: Successful: Unsuccessful:

avatar heelc29
heelc29
23 Dec 2022

Summary of Changes

Add created_by to list select query to get article items.

The created_by property is required if the core.edit permission is not allowed. Function was added with #36559.

if (
$user->authorise('core.edit', 'com_content.article.' . $item->id)
|| ($user->authorise('core.edit.own', 'com_content.article.' . $item->id) && ($userId === $item->created_by))
) {

Testing Instructions

Check the admin dashboard with a user with these permissions on com_content:
image

Actual result BEFORE applying this Pull Request

PHP Warning: Undefined property: stdClass::$created_by in [ROOT]\administrator\modules\mod_popular\src\Helper\PopularHelper.php on line 90
image

Expected result AFTER applying this Pull Request

Link to edit own article is displayed (and no PHP warning)
image

Link to documentations

Please select:

  • No documentation changes for docs.joomla.org needed
  • No documentation changes for manual.joomla.org needed
avatar joomla-cms-bot joomla-cms-bot - change - 23 Dec 2022
Category Modules Administration
avatar heelc29 heelc29 - open - 23 Dec 2022
avatar heelc29 heelc29 - change - 23 Dec 2022
Status New Pending
avatar carlitorweb carlitorweb - test_item - 24 Dec 2022 - Tested successfully
avatar carlitorweb
carlitorweb - comment - 24 Dec 2022

I have tested this item successfully on 59956eb

Note: For get the right permission the test require, is enough with create a user under Author group and add the "Access Administration Access" from the global configuration permissions.


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

avatar ReLater ReLater - test_item - 25 Dec 2022 - Tested successfully
avatar ReLater
ReLater - comment - 25 Dec 2022

I have tested this item successfully on 59956eb


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

avatar richard67 richard67 - change - 25 Dec 2022
Status Pending Ready to Commit
Labels Added: ?
avatar richard67
richard67 - comment - 25 Dec 2022

RTC


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

avatar wilsonge wilsonge - change - 28 Dec 2022
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-12-28 12:21:11
Closed_By wilsonge
Labels Added: ? Maintainers Checked
avatar wilsonge wilsonge - close - 28 Dec 2022
avatar wilsonge wilsonge - merge - 28 Dec 2022
avatar wilsonge
wilsonge - comment - 28 Dec 2022

Thanks!

Add a Comment

Login with GitHub to post a comment