TaxonomyReorder.php Error on Line 141
Support › Meta Box AIO › TaxonomyReorder.php Error on Line 141
- This topic has 8 replies, 2 voices, and was last updated 2 hours, 38 minutes ago by
Peter.
-
AuthorPosts
-
December 3, 2025 at 6:38 AM #49465
KG
ParticipantHello,
I just created a new Services taxonomy for a CPT. Both the CPT and Taxonomy items show in my admin menu, but when I try to add a new taxonomy term, I am receiving the following error:
.../app/public/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-custom-post-type/src/TaxonomyReorder.php on line 141
In case you need the info: I'm currently using the Blocksy theme (free version) and running on a local development server (LocalWP).
Since this php file is generated by Meta Box, I don't know how to resolve the error. So it's easier for you to review, I've copied the code from the TaxonomyReorder.php file below. The line 141 referenced by the error code is 'term_order' => $term->term_order == 0 ? $all_term_map[ $term->ID ]->term_order : $term->term_order,:
private function get_hierarchical_terms( string $taxonomy, array $all_terms, int $current_page, int $per_page ): array {
// Filter top-level terms (parent = 0) for pagination
$top_level_posts = array_filter( $all_terms, function ( $post ) {
return $post->parent == 0;
} );
$top_level_ids = wp_list_pluck( $top_level_posts, 'term_id' );// Split top-level IDs into chunks
$top_level_chunks = array_chunk( $top_level_ids, $per_page );
$current_top_level_ids = $top_level_chunks[ $current_page - 1 ] ?? [];// Build a list of IDs to fetch: current top-level IDs + all their descendants
$term_ids_to_fetch = $current_top_level_ids;
$all_term_map = array_column( $all_terms, null, 'term_id' ); // Map for quick lookup
foreach ( $current_top_level_ids as $parent_id ) {
// Recursively find all children
$term_ids_to_fetch = array_merge( $term_ids_to_fetch, $this->get_children( $parent_id, $all_term_map ) );
}$term_ids_to_fetch = array_unique( $term_ids_to_fetch ); // Remove duplicates
// Fetch full post data only if we have IDs to fetch
$terms = [];
if ( ! empty( $term_ids_to_fetch ) ) {
$args = [
'taxonomy' => $taxonomy,
'include' => $term_ids_to_fetch,
'hide_empty' => false,
'orderby' => 'include',
'number' => 0,
];$full_query = get_terms( $args );
$terms = array_map( function ( $term ) use ( $all_term_map ) {
return [
'term_id' => $term->term_id,
'name' => $term->name,
'parent' => $term->parent,
'term_order' => $term->term_order == 0 ? $all_term_map[ $term->ID ]->term_order : $term->term_order,
];
}, $full_query);
}return $terms;
}Appreciate the help,
Kellie
December 3, 2025 at 7:18 AM #49466KG
ParticipantAs an update to my original post:
If I toggle "Re-Order Terms" in the Taxonomy Features tab to OFF, the error on line 141 disappears. However, if I try to save a new taxonomy term by clicking on the Add New button, my screen freezes. If I then click out of the taxonomy screen and then go back in, it does seem to save the new taxonomy term.
December 3, 2025 at 11:08 PM #49473Peter
ModeratorHello Kellile,
Thanks for reaching out.
I am receiving the following error: .../app/public/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-custom-post-type/src/TaxonomyReorder.php on line 141Could you please share the full error message so I can understand it? I think the issue happens with this code
$all_term_map[ $term->ID ]->term_orderit should be
$all_term_map[ $term->term_id ]->term_orderIf you can edit the file on your end, let me know if it helps.
December 4, 2025 at 12:58 AM #49478KG
ParticipantHi Peter,
Appreciate the help.
Unfortunately, I can't copy the entire error line because it's being cut off on the left side. I'm not seeing a scroll bar on my screen to scroll to the beginning of the line, but here's what I managed to copy:
roperty "term_order" on null in /home/localsvr/Local Sites/cctest/app/public/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-custom-post-type/src/TaxonomyReorder.php on line 141
The good news is: changing line 141 using your code fix seems to have solved the error line problem.
The bad news is: when I try to save the taxonomy, the cursor "spins" indefinitely without refreshing the screen, so it doesn't look like it's saving the new terms. If I click on one of the column headings or if click out of the taxonomy screen and then go back in, it updates the screen and the new record appears.
The same scenario happens when I click on the Reorder link.
Thanks again,
December 4, 2025 at 8:54 PM #49484Peter
ModeratorHello,
Please share your site admin account by submitting this contact form https://metabox.io/contact/
I will take a look.
December 5, 2025 at 12:20 AM #49490KG
ParticipantHi Peter,
I'm developing on LocalWP. From what I understand, I can enable "Live Link" to allow remote users to view the site, but it doesn't allow access to the back end.
In other words, I don't think I can share my site admin account.
I just ran the latest Metabox update to see if that corrected the problem, but no success. I also changed themes to Twenty-Twenty Five, but still no success.
Since I'm running LocalWP, do you have any ideas on how to give you admin access, or have any other suggestions on how to proceed?
Thanks.
December 5, 2025 at 9:58 PM #49505Peter
ModeratorHello,
You can enable WP debug log and reproduce the issue on your site, then share the error message in the debug log with me. I will help you check the issue.
Following the documentation
https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/Thanks.
December 6, 2025 at 2:40 AM #49506KG
ParticipantI updated my wp-config.php file to turn debugging on. Unfortunately, I'm not finding a debug.log file even though when I look in the WP Dashboard under Site Health (Info tab / WordPress Constants subheading) it says WP_DEBUG is Enabled, WP_DEBUG_DISPLAY is Disabled, WP_DEBUG_LOG is Enabled, and SCRIPT_DEBUG is Disabled.
I also have a Site Health (Status tab) critical issue that says "Your site is set to log errors to a potentially public file."
Even though it appears debugging is on, when I search for the debug.log file using Filezilla nothing turns up.
I did, however, find this error.log file in the logs/php folder. It contains the following:
[05-Dec-2025 04:36:31 UTC] PHP Warning: Undefined array key "relation" in /home/localsvr/Local Sites/cctest/app/public/wp-content/plugins/meta-box-aio/vendor/wpmetabox/mbb-parser/src/Parsers/Base.php on line 168
The error for line 141 that you provided the fix for was also in the same file:
[02-Dec-2025 22:57:10 UTC] PHP Warning: Attempt to read property "term_order" on null in /home/localsvr/Local Sites/cctest/app/public/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-custom-post-type/src/TaxonomyReorder.php on line 141
(Since you gave me the code fix, the error is no longer appearing in this file.)
Unfortunately the PHP Warning listed above doesn't seem to be the correct message for the problem I have saving taxonomy terms--I just tried saving a new term and the screen is still going into limbo when I click on the save button, but nothing new was written to the error.log file.
Let me know if there's anything else I can send you to help resolve the problem.
Thanks.
December 7, 2025 at 8:52 PM #49513Peter
ModeratorHello,
The issue with the taxonomy term could be affected by a third-party plugin or custom code on your site. Please try to deactivate all plugins except Meta Box, switch to a WordPress theme and recheck this.
If it still doesn't help, you can copy your local site to an online hosting, then share the admin account with me. I will help you investigate the issue.
-
AuthorPosts
- You must be logged in to reply to this topic.