Opened 11 years ago
Last modified 7 years ago
#28297 new defect (bug)
Losing custom nav menu data while importing / exporting XML
Reported by: | isharis | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 3.9.1 |
Component: | Import | Keywords: | needs-patch needs-testing |
Focuses: | Cc: |
Description
I have added few fields to the menu for mega menu functionality: https://gist.github.com/mharis/150f43e09adf72d7d0bb
This works fine and when I tried to export the site content which did have all the navigation items and the custom fields and its values in the XML file (https://www.dropbox.com/s/7i2l3x2mvpgup58/xml-test.xml) which is perfectly fine.
The problem happens when importing, only the keys are imported for the custom navigation menu fields and not its value. The values are stripped even through the data seems correct in the XML file.
Any thoughts over it?
Attachments (1)
Change History (4)
#1
in reply to:
↑ description
@
11 years ago
#3
@
7 years ago
I found and fixed the issue in wordpress-importer.php, actually using our patched library for demo site importing in our plugins, which isn't good as it will break if any core update will occur. So i'm sharing the fix in case you want to provide an official upgrade of the file.
<?php ${$meta['key']} = $meta['value'];
and NOT
<?php $$meta['key'] = $meta['value'];
Replying to isharis:
Fixed . Sorry about the typos.