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

Undefined array key "instance_id" in app/core/SettingsPiwik.php:482 #19557

Closed
mattmary opened this issue Jul 22, 2022 · 1 comment · Fixed by #19561
Closed

Undefined array key "instance_id" in app/core/SettingsPiwik.php:482 #19557

mattmary opened this issue Jul 22, 2022 · 1 comment · Fixed by #19561
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

@mattmary
Copy link
Contributor

Hi I get a warning on an undefined array key when rendering a report in the wordpress plugin.
I create this issue in the matomo tracker because we don't access this key in the plugin: we process only the generated reports.

Expected Behavior

No Notice

Current Behavior

Error call stack:

wp-content/plugins/matomo/app/core/SettingsPiwik.php:482
Piwik\SettingsPiwik::getPiwikInstanceId()
wp-content/plugins/matomo/app/core/Segment.php:192
Piwik\Segment->getAvailableSegments()
wp-content/plugins/matomo/app/core/Segment.php:214
Piwik\Segment->getSegmentByName()
wp-content/plugins/matomo/app/core/Segment.php:276
Piwik\Segment->getExpressionsWithUnionsResolved()
wp-content/plugins/matomo/app/core/Segment.php:254
Piwik\Segment->initializeSegment()
wp-content/plugins/matomo/app/core/Segment.php:150
Piwik\Segment->__construct()
wp-content/plugins/matomo/app/core/Archive/ArchiveQueryFactory.php:128
Piwik\A\ArchiveQueryFactory->getSegmentFromQueryParam()
wp-content/plugins/matomo/app/core/Archive/ArchiveQueryFactory.php:32
Piwik\A\ArchiveQueryFactory->build()
wp-content/plugins/matomo/app/core/Archive.php:218
Piwik\Archive::build()
wp-content/plugins/matomo/app/plugins/Goals/API.php:540
Piwik\P\G\API->getMetrics()
Unknown location
Piwik\API\Proxy->Piwik\API\{closure}()
wp-content/plugins/matomo/app/core/Context.php:28
Piwik\Context::executeWithQueryParameters()
wp-content/plugins/matomo/app/core/API/Proxy.php:335
Piwik\API\Proxy->call()
wp-content/plugins/matomo/app/core/API/Request.php:266
Piwik\API\Request->process()
wp-content/plugins/matomo/app/core/API/Request.php:559
Piwik\API\Request::processRequest()
wp-content/plugins/matomo/app/plugins/Goals/API.php:500
Piwik\P\G\API->get()
Unknown location
Piwik\API\Proxy->Piwik\API\{closure}()
wp-content/plugins/matomo/app/core/Context.php:28
Piwik\Context::executeWithQueryParameters()
wp-content/plugins/matomo/app/core/API/Proxy.php:335
Piwik\API\Proxy->call()
wp-content/plugins/matomo/app/core/API/Request.php:266
Piwik\API\Request->process()
wp-content/plugins/matomo/app/plugins/API/ProcessedReport.php:377
Piwik\P\A\ProcessedReport->getProcessedReport()
wp-content/plugins/matomo/app/plugins/API/API.php:283
Piwik\P\A\API->getProcessedReport()
Unknown location
Piwik\API\Proxy->Piwik\API\{closure}()
wp-content/plugins/matomo/app/core/Context.php:28
Piwik\Context::executeWithQueryParameters()
wp-content/plugins/matomo/app/core/API/Proxy.php:335
Piwik\API\Proxy->call()
wp-content/plugins/matomo/app/core/API/Request.php:266
Piwik\API\Request->process()
wp-content/plugins/matomo/app/core/API/Request.php:559
Piwik\API\Request::processRequest()
wp-content/plugins/matomo/classes/WpMatomo/Report/Data.php:54
WpMatomo\R\Data->fetch_report()
wp-content/plugins/matomo/classes/WpMatomo/Report/Renderer.php:100
WpMatomo\R\Renderer->show_report()
wp-includes/shortcodes.php:356
do_shortcode_tag()
Unknown location
preg_replace_callback()
wp-includes/shortcodes.php:228
do_shortcode()
wp-content/plugins/matomo/classes/WpMatomo/Admin/views/summary.php:154
WpMatomo\A\Summary->show()
wp-includes/class-wp-hook.php:307
do_action('matomo-analytics_page_matomo-summary')
wp-admin/admin.php:259

Possible Solution

Steps to Reproduce (for Bugs)

1.Install wordpress
2.Install the wordpress plugin
3.Install the plugin query monitor
4.Log in the wordpress back-office
5.Open the URL wp-admin/admin.php?page=matomo-summary
6.See in the php error tab of the query monitor plugin the warning

Context

Your Environment

  • Matomo Version: 4.10.0
  • PHP Version: 8.0.21
  • Server Operating System: Ubuntu
@mattmary mattmary added the Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. label Jul 22, 2022
@sgiehl
Copy link
Member

sgiehl commented Jul 22, 2022

That one should actually be suppressed using @, but I'll prepare a code change nevertheless.

@sgiehl sgiehl self-assigned this Jul 22, 2022
@sgiehl sgiehl added this to the 4.12.0 milestone Jul 22, 2022
@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 Jul 22, 2022
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.

2 participants