Opened 8 years ago
Closed 8 years ago
#40596 closed defect (bug) (duplicate)
Import nav_menu_item fails on PHP 7
Reported by: | RavanH | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.7.4 |
Component: | Import | Keywords: | |
Focuses: | Cc: |
Description
When I do a WordPress Export and then an Import it on another WordPress install, all menus are imported as expected but they are empty. It appears menu items are skipped for some reason.
Looking through the export xml file, I find all items of post-type nav_menu_item are there, so the problem must lie with the import.
Change History (9)
#3
@
8 years ago
On PHP 5.6 it turns out there is no problem with importing menu items. Issue seems PHP 7 (7.0 and 7.1) related only.
#4
@
8 years ago
- Summary changed from Export/import creates empty menus to Import nav_menu_item fails on PHP 7
#5
@
8 years ago
Meta variables are undefined, because syntax of variable variables changed in PHP7. So if you change line 884 in wordpress-importer.php
<?php $$meta['key'] = $meta['value'];
to
<?php ${$meta['key']} = $meta['value'];
should do the trick. Unable to test it myself.
Note: See
TracTickets for help on using
tickets.
WP_DEBUG log shows these notices
but no errors are reported. This is on PHP7, will test on PHP5.6 now...