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

Fixed Undefined array key 266 rollbar 17086 #12720

Merged
merged 1 commit into from
Mar 24, 2023

Conversation

inietov
Copy link
Collaborator

@inietov inietov commented Mar 23, 2023

Description

When a user have a lot of status labels to show in the dashboard's pie chart (the one above), if the statuses are more than the colors we have by default (266) the pie chart doesn't show because of this index out of range.

I don't know if it's the proper solution, but I just added a condition to 'restart' the color index, making that the colors repeat from the beginning when show in the pie chart. This makes for 532 statuses, that seems plenty but with enough status labels the system can get to crash again... but I'm unsure how to handle it because I don't know how to return an error to the dashboard...

Fixes rollbar 17086

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Test Configuration:

  • PHP version: 8.2
  • MySQL version: 8.0.31
  • Webserver version: PHP Dev Server
  • OS version: Debian 11

@what-the-diff
Copy link

what-the-diff bot commented Mar 23, 2023

PR Summary

  • Improved defaultChartColors function The function now handles cases where the provided index is greater than or equal to the total number of colors, ensuring a valid color is always returned.

@snipe snipe merged commit 642d1e9 into snipe:develop Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants