Skip to content

[4.2] fix admin module popular#39482

Merged
wilsonge merged 1 commit intojoomla:4.2-devfrom
heelc29:4.2/admin/modules/popular
Dec 28, 2022
Merged

[4.2] fix admin module popular#39482
wilsonge merged 1 commit intojoomla:4.2-devfrom
heelc29:4.2/admin/modules/popular

Conversation

@heelc29
Copy link
Copy Markdown
Contributor

@heelc29 heelc29 commented Dec 23, 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

@carlitorweb
Copy link
Copy Markdown
Member

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.

@ReLater
Copy link
Copy Markdown
Contributor

ReLater commented Dec 25, 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.

@richard67
Copy link
Copy Markdown
Member

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Dec 25, 2022
@richard67 richard67 added the Maintainers Checked Used if the PR is conceptional useful label Dec 25, 2022
@wilsonge wilsonge merged commit 51795bb into joomla:4.2-dev Dec 28, 2022
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Dec 28, 2022
@wilsonge
Copy link
Copy Markdown
Contributor

Thanks!

@wilsonge wilsonge added this to the Joomla! 4.2.7 milestone Dec 28, 2022
@heelc29 heelc29 deleted the 4.2/admin/modules/popular branch December 29, 2022 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Maintainers Checked Used if the PR is conceptional useful

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants