Skip to content

Menu Items missing after import with PHP 7.0 #63

@andi-blafasl

Description

@andi-blafasl

Hi,
This is no issue with your test data, but I think it would be a good place to document the issue. Maybe some other users will hit the Bug when importing the test data. The bug is in the current WordPress importer plugin when using it with PHP 7.0
During the Import of the XML there is no error message displayed and the importer finishes without problems. Everything is imported, including the menus them self, but they are empty!
The Bug is documented here https://core.trac.wordpress.org/ticket/36281 and https://wordpress.org/support/topic/fails-to-export-or-import-menu-items-when-using-php7/

To fix it you have to change the file wp-content/plugins/wordpress-importer/wordpress-importer.php at line 884

from

$$meta['key'] = $meta['value'];

to

${$meta['key']} = $meta['value'];

Just add the two brackets and you are good to go.

I tested this on my wordpress 4.8.2 running on Ubuntu 16.04 with php 7.0

Hope this will help any future user to save some time searching for a solution

Regards,
Andreas

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions