Skip to content

fix(system): drop deprecated by-reference form on uploader error fetches#43

Merged
mambax7 merged 1 commit into
XOOPS:masterfrom
mambax7:feature/system-uploader-by-ref-fix
May 4, 2026
Merged

fix(system): drop deprecated by-reference form on uploader error fetches#43
mambax7 merged 1 commit into
XOOPS:masterfrom
mambax7:feature/system-uploader-by-ref-fix

Conversation

@mambax7
Copy link
Copy Markdown
Contributor

@mambax7 mambax7 commented May 4, 2026

Proposed commit / PR body:
PHP 8 deprecation cleanup in four System admin upload handlers.

system/admin/{avatars,images,smilies,userrank}/main.php:
Each file's upload-failure branch wrote
$err[] = & $uploader->getErrors();
i.e. assign-by-reference to the array result of a method call.
This idiom has been a deprecation notice since PHP 7.4 and is
an outright error in current PHP 8.x runs, so every failed
upload was emitting a deprecation warning into admin output.
getErrors() returns an array by value; the assignment is
always copy semantics anyway, so the & is removed.

  Proposed commit / PR body:
  PHP 8 deprecation cleanup in four System admin upload handlers.

  system/admin/{avatars,images,smilies,userrank}/main.php:
    Each file's upload-failure branch wrote
        $err[] = & $uploader->getErrors();
    i.e. assign-by-reference to the array result of a method call.
    This idiom has been a deprecation notice since PHP 7.4 and is
    an outright error in current PHP 8.x runs, so every failed
    upload was emitting a deprecation warning into admin output.
    getErrors() returns an array by value; the assignment is
    always copy semantics anyway, so the `& ` is removed.
Copilot AI review requested due to automatic review settings May 4, 2026 10:36
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

Warning

Rate limit exceeded

@mambax7 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 24 minutes and 26 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 11f13760-857f-435e-8822-6fbdabbe5719

📥 Commits

Reviewing files that changed from the base of the PR and between dd64362 and d0c216c.

📒 Files selected for processing (4)
  • htdocs/modules/system/admin/avatars/main.php
  • htdocs/modules/system/admin/images/main.php
  • htdocs/modules/system/admin/smilies/main.php
  • htdocs/modules/system/admin/userrank/main.php
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 24 minutes and 26 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 4, 2026

@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.08%. Comparing base (9c78ad2) to head (d0c216c).
⚠️ Report is 36 commits behind head on master.

Files with missing lines Patch % Lines
htdocs/modules/system/admin/avatars/main.php 0.00% 1 Missing ⚠️
htdocs/modules/system/admin/images/main.php 0.00% 1 Missing ⚠️
htdocs/modules/system/admin/smilies/main.php 0.00% 1 Missing ⚠️
htdocs/modules/system/admin/userrank/main.php 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master      #43      +/-   ##
============================================
- Coverage     19.23%   18.08%   -1.15%     
- Complexity     7584     7840     +256     
============================================
  Files           621      665      +44     
  Lines         40085    42982    +2897     
============================================
+ Hits           7709     7775      +66     
- Misses        32376    35207    +2831     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request removes deprecated assign-by-reference usage when collecting upload errors in System admin upload handlers, preventing PHP 8.x deprecation notices/errors during failed uploads.

Changes:

  • Replaced $err[] = & $uploader->getErrors(); with $err[] = $uploader->getErrors(); in four System admin controllers.
  • Keeps existing error-collection behavior (still compatible with xoops_error() which handles strings/arrays recursively).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
htdocs/modules/system/admin/userrank/main.php Removes by-reference assignment when appending uploader errors for rank image uploads.
htdocs/modules/system/admin/smilies/main.php Removes by-reference assignment when appending uploader errors for smilie image uploads.
htdocs/modules/system/admin/images/main.php Removes by-reference assignment when appending uploader errors for image uploads.
htdocs/modules/system/admin/avatars/main.php Removes by-reference assignment when appending uploader errors for avatar uploads.

@mambax7 mambax7 merged commit c653b96 into XOOPS:master May 4, 2026
13 of 15 checks passed
@mambax7 mambax7 deleted the feature/system-uploader-by-ref-fix branch May 15, 2026 12:54
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.

2 participants