Fix PHP notice "Undefined variable: article" for action logs #33941
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 usingActionlogsHelper::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
Set error reporting to maximum and log PHP errors into a file.
Upload an item into the media manager.
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.
Change the options of an extension and check that the action is logged correctly.
Install or uninstall an extension and check that the action is logged correctly.
Check your PHP log if there are logged any PHP notices.
Result. The PHP error log shows PHP notice(s) "Undefined variable: article".
Apply the patch of this PR.
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.