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

[PHP8.1] Deprecated return type of HTML_QuickForm2_ContainerIterator #18374

Closed
MichaIng opened this issue Nov 24, 2021 · 7 comments · Fixed by #18384
Closed

[PHP8.1] Deprecated return type of HTML_QuickForm2_ContainerIterator #18374

MichaIng opened this issue Nov 24, 2021 · 7 comments · Fixed by #18384
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Milestone

Comments

@MichaIng
Copy link
Contributor

Even after #18309 there are still two deprecation warnings in this script:

PHP Deprecated:  Return type of HTML_QuickForm2_ContainerIterator::hasChildren() should either be compatible with RecursiveArrayIterator::hasChildren(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/matomo/libs/HTML/QuickForm2/Container.php on line 68
PHP Deprecated:  Return type of HTML_QuickForm2_ContainerIterator::getChildren() should either be compatible with RecursiveArrayIterator::getChildren(): ?RecursiveArrayIterator, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/matomo/libs/HTML/QuickForm2/Container.php on line 74

Expected Behavior

No deprecation warnings.

Current Behavior

Deprecation warnings as shown above.

Possible Solution

While this is not a good solution, I currently muted those via:

    #[\ReturnTypeWillChange]
    public function hasChildren()
    {
        return $this->current() instanceof HTML_QuickForm2_Container;
    }

    #[\ReturnTypeWillChange]
    public function getChildren()
    {
        return new HTML_QuickForm2_ContainerIterator($this->current());
    }

Steps to Reproduce (for Bugs)

  1. Install php8.1-fpm
  2. Access and browse Matomo web interface, through I couldn't identify the exact element/page which triggers this.

Context

Your Environment

  • Matomo Version: v4.6.0-rc2
  • PHP Version: 8.1.0RC6
  • Server Operating System: Debian Bookworm
  • Additionally installed plugins:
API, Actions, Annotations, BulkTracking, CoreAdminHome, CoreConsole, CoreHome, CorePluginsAdmin, CoreUpdater, CoreVisualizations, CoreVue, DBStats, DarkTheme 1.1.7, Dashboard, DevicePlugins, DevicesDetection, Diagnostics, Goals, IPReports 4.1.1, ImageGraph, Insights, Installation, Intl, LanguagesManager, Live, LogViewer 4.0.1, Login, Marketplace, Monolog, Morpheus, PagePerformance, PrivacyManager, Proxy, Referrers, Resolution, SEO, SegmentEditor, SitesManager, TrackingSpamPrevention 4.1.0, Transitions, UserLanguage, UsersManager, VisitFrequency, VisitTime, VisitorInterest, VisitsSummary, WebsiteMeasurable
@MichaIng MichaIng added the Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. label Nov 24, 2021
@sgiehl
Copy link
Member

sgiehl commented Nov 25, 2021

Hi @MichaIng. Thanks for the report. We have already fixed those with #18309

@sgiehl sgiehl closed this as completed Nov 25, 2021
@sgiehl sgiehl added duplicate For issues that already existed in our issue tracker and were reported previously. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. labels Nov 25, 2021
@MichaIng
Copy link
Contributor Author

MichaIng commented Nov 25, 2021

As said, I'm using v4.6.0-rc2 already, which contains these commits but still face the warnings.

@Findus23
Copy link
Member

It seems like this is indeed after #18309 as otherwise RecursiveArrayIterator::hasChildren(): would not be in line 68.

@Findus23 Findus23 reopened this Nov 25, 2021
@Findus23 Findus23 added Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. and removed duplicate For issues that already existed in our issue tracker and were reported previously. labels Nov 25, 2021
@sgiehl sgiehl added Bug For errors / faults / flaws / inconsistencies etc. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. labels Nov 26, 2021
@sgiehl sgiehl added this to the 4.6.0 milestone Nov 26, 2021
@sgiehl
Copy link
Member

sgiehl commented Nov 26, 2021

Ah sorry. Seems I missed that.

@sgiehl sgiehl self-assigned this Nov 26, 2021
@sgiehl sgiehl linked a pull request Nov 26, 2021 that will close this issue
11 tasks
@justinvelluppillai justinvelluppillai modified the milestones: 4.6.0, 4.7.0 Nov 30, 2021
@justinvelluppillai
Copy link
Contributor

Hi @MichaIng it'd be great if you can confirm that the fix we have applied resolves this for you and comment here or reopen if needed as we weren't able to reproduce the issue.

@MichaIng
Copy link
Contributor Author

MichaIng commented Dec 2, 2021

I did already test it by applying the changes manually, and I didn't face these warnings anymore 🙂. Many thanks 👍.

@justinvelluppillai
Copy link
Contributor

Great, thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants