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

8: Undefined index: label, xxx/Themes/default/GenericMenu.template.php (Line 121) #7559

Closed
sbulen opened this issue Oct 8, 2022 · 3 comments · Fixed by #7733
Closed

8: Undefined index: label, xxx/Themes/default/GenericMenu.template.php (Line 121) #7559

sbulen opened this issue Oct 8, 2022 · 3 comments · Fixed by #7733
Assignees
Milestone

Comments

@sbulen
Copy link
Contributor

sbulen commented Oct 8, 2022

Description

On occasion, I get an "Undefined index: label" error in the log. In this instance, the user is a global moderator, but doesn't have many of the moderation permissions.

Environment (complete as necessary)

  • Version/Git revision: Current GH
  • Database Type: MySQL
  • Database Version: 8.0
  • PHP Version: 8.1

Additional information/references

At issue is this logic:

// Set which one is first, last and selected in the group.

Under certain (rare) circumstances, it can get to that logic without $first_sa and $last_sa being set. E.g., if the user doesn't have permission to do any of the activities in the submenu. First & last end up getting set on an undefined/null new entry. The template can't find the label, because it is null:
image

@jdarwood007
Copy link
Member

Do we really need is_first and is_last? This seems like a hold over from when we couldn't handle this with pure CSS.
If we need it we should be able to use array_key_first and array_key_last.

@sbulen
Copy link
Contributor Author

sbulen commented Oct 10, 2022

Good point.

I'm still confused why it's building this menu at all. It's not displayed. And this error comes from clicking for the alert popup.

@live627 live627 self-assigned this Oct 10, 2022
@live627 live627 added this to the 2.1.4 milestone Oct 10, 2022
@sbulen sbulen removed this from the 2.1.4 milestone Mar 12, 2023
@sbulen
Copy link
Contributor Author

sbulen commented Apr 22, 2023

@live627 - I ended up taking a stab at this...

@sbulen sbulen added this to the 2.1.5 milestone Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants