-
Notifications
You must be signed in to change notification settings - Fork 20
[#3563874] Updated check for when menu item titles are render arrays. #1459
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
Conversation
📝 WalkthroughWalkthroughModified menu item title normalization in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
web/themes/contrib/civictheme/includes/menu.inc (1)
30-35: Logic correctly handles renderable titles.The
is_string()check appropriately preventsstrip_tags()from being called on renderable arrays, which would cause warnings. Non-string titles are preserved for Drupal's render system to handle.However, the PR checklist indicates tests were not run. Please verify this change works correctly with both string titles and renderable titles.
Optional: Add clarifying comment
Adding a comment would help future maintainers understand why non-string titles are preserved:
+ // Preserve non-string titles (e.g., renderable arrays) for Drupal's render system. if (isset($item['title'])) { $item['title'] = is_string($item['title']) ? strip_tags($item['title']) : $item['title']; }
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
web/themes/contrib/civictheme/includes/menu.inc
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: joshua-salsadigital
Repo: civictheme/monorepo-drupal PR: 1350
File: web/themes/contrib/civictheme/includes/primary_navigation.inc:17-23
Timestamp: 2025-08-04T18:38:53.749Z
Learning: In CivicTheme, the `expand_all_items` configuration setting is only valid for sidebar menu links. Primary and secondary navigation menus should hardcode FALSE when calling `_civictheme_preprocess_menu_items()` and should not read the `expand_all_items` configuration.
📚 Learning: 2025-08-04T18:38:53.749Z
Learnt from: joshua-salsadigital
Repo: civictheme/monorepo-drupal PR: 1350
File: web/themes/contrib/civictheme/includes/primary_navigation.inc:17-23
Timestamp: 2025-08-04T18:38:53.749Z
Learning: In CivicTheme, the `expand_all_items` configuration setting is only valid for sidebar menu links. Primary and secondary navigation menus should hardcode FALSE when calling `_civictheme_preprocess_menu_items()` and should not read the `expand_all_items` configuration.
Applied to files:
web/themes/contrib/civictheme/includes/menu.inc
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: commit
🔇 Additional comments (1)
web/themes/contrib/civictheme/includes/menu.inc (1)
29-29: Good defensive initialization.Ensuring
belowis always an array prevents potential issues in the recursive call.
0b57b9b to
5518778
Compare
JIRA ticket: #3563874
Checklist before requesting a review
Changed
Background
Comes from this conversation thread: https://drupal.slack.com/archives/C039UV0CQBZ/p1765788174230759?thread_ts=1765470743.227649&cid=C039UV0CQBZ
Screenshots
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.