-
Notifications
You must be signed in to change notification settings - Fork 34
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
PLANET-7714 Fix Sentry errors #2490
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -414,7 +414,9 @@ function render_navigation_block(array $attributes): string | |||||
// For parent pages, get the previous and next siblings in the menu order | ||||||
$output = ''; | ||||||
$siblings = array_filter($menu_items, function ($item) use ($nav_menu_item) { | ||||||
return $item->menu_item_parent === $nav_menu_item->menu_item_parent; | ||||||
return $item !== null | ||||||
&& $nav_menu_item !== null | ||||||
&& $item->menu_item_parent === $nav_menu_item->menu_item_parent; | ||||||
}); | ||||||
|
||||||
$siblings = array_values($siblings); | ||||||
|
@@ -435,7 +437,7 @@ function render_navigation_block(array $attributes): string | |||||
// For child pages, only show link to the parent | ||||||
if ($submenu_page->menu_item_parent !== 0) { | ||||||
$parent_item = array_filter($menu_items, function ($item) use ($submenu_page) { | ||||||
return (int) $item->ID === (int) $submenu_page->menu_item_parent; | ||||||
return $submenu_page !== null && (int) $item->ID === (int) $submenu_page->menu_item_parent; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here:
Suggested change
|
||||||
}); | ||||||
|
||||||
$parent_item = reset($parent_item); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want to modify a migration script that was already run? |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,11 +20,11 @@ | |
} | ||
|
||
$tag = get_queried_object(); | ||
$redirect_id = get_term_meta($tag->term_id, 'redirect_page', true); | ||
$redirect_id = $tag !== null && get_term_meta($tag->term_id, 'redirect_page', true); | ||
$redirect_page = get_post($redirect_id); | ||
|
||
if ($redirect_id) { | ||
if ($redirect_page) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
global $wp_query; | ||
$redirect_page = get_post($redirect_id); | ||
$wp_query->queried_object = $redirect_page; | ||
$wp_query->queried_object_id = $redirect_page->ID; | ||
|
||
|
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.
Can we make it simpler?