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

Type mismatch found in file -> inc /migrate.php #27

Closed
emaralive opened this issue Oct 18, 2023 · 1 comment
Closed

Type mismatch found in file -> inc /migrate.php #27

emaralive opened this issue Oct 18, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@emaralive
Copy link

The type mismatch occurs on line 71 of inc/migrate.php. The mismatch is due to "string" vs "integer" in the "in_array" function due to the parameter "strict" set to true. The needle ($item->object_id) is a "string" and the haystack ($nav_menu_item_ids) is an array of "integers", thus what would be qualified menu items fail to be updated. Changing line 71:

From:
if ( $old_post_type !== $item->object || ! in_array( $item->object_id, $nav_menu_item_ids, true ) ) {

To:
if ( $old_post_type !== $item->object || ! in_array( (int) $item->object_id, $nav_menu_item_ids, true ) ) {

This would suffice but, I'll leave it up to the appropriate person to apply an appropriate fix.
`

@emaralive emaralive changed the title Type mismatch on found in file -> inc /migrate.php Type mismatch found in file -> inc /migrate.php Oct 18, 2023
@imath imath self-assigned this Oct 19, 2023
@imath imath added the bug Something isn't working label Oct 19, 2023
@imath
Copy link
Member

imath commented Oct 19, 2023

Hi @emaralive Thanks for raising this issue. I will look at it more deeply asap.

@imath imath closed this as completed in ab5007c Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants