Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PHP notice "Undefined variable: article" for action logs #33941

Merged

Conversation

richard67
Copy link
Member

Pull Request for #31836 (comment) .

Summary of Changes

Fix PHP notice caused by an undefined variable $article being used as function parameter where it should be null, see other places in that file using ActionlogsHelper::getContentTypeLink without a media object.

The notice is caused by PR #31836 which has impelemnted that code. It looks like a remainder from copy and paste.

Testing Instructions

  1. Set error reporting to maximum and log PHP errors into a file.

  2. Upload an item into the media manager.

  3. Check in the action log for the action from step 2 that the link on the uploaded file name is correct and leads to the folder of the uploaded item.

  4. Change the options of an extension and check that the action is logged correctly.

  5. Install or uninstall an extension and check that the action is logged correctly.

  6. Check your PHP log if there are logged any PHP notices.

Result. The PHP error log shows PHP notice(s) "Undefined variable: article".

  1. Apply the patch of this PR.

  2. Repeat steps 2 to 6.

Result. No PHP notice(s) "Undefined variable: article".

Actual result BEFORE applying this Pull Request

Action log works, but you get a PHP notice "Undefined variable: article"

Expected result AFTER applying this Pull Request

Action log still works as before, but there is no PHP notice "Undefined variable: article".

Documentation Changes Required

None.

@chmst
Copy link
Contributor

chmst commented May 18, 2021

I have tested this item ✅ successfully on 03684cc


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

@richard67 richard67 added this to the Joomla! 3.9.27 milestone May 18, 2021
@alikon
Copy link
Contributor

alikon commented May 18, 2021

I have tested this item ✅ successfully on 03684cc


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

@joomla-cms-bot joomla-cms-bot removed this from the Joomla! 3.9.27 milestone May 18, 2021
@alikon
Copy link
Contributor

alikon commented May 18, 2021

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label May 18, 2021
@richard67 richard67 added this to the Joomla! 3.9.27 milestone May 18, 2021
@HLeithner HLeithner merged commit 241925d into joomla:staging May 18, 2021
@HLeithner
Copy link
Member

thanks

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label May 18, 2021
@richard67 richard67 deleted the staging-actionlogs-fix-php-notice-article branch May 18, 2021 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants