Hello,
Do you notice anything in debug.log when the error occurs?
Could you please give me some steps that I can follow to recreate the problem?
Thank you.
Hi Steven! Thanks for looking into this.
Tested with Twenty Fifteen theme. To recreate the problem:
1. Activate Jetpack
2. Enable the Widget Visibility feature in Jetpack
3. Add widgets to widget areas.
4. Create Visibility rules on those widgets
5. Export widgets with Widget Importer & Exporter
6. On a different WordPress install, import the .wie file
7. Navigate to the widgets page. It’s frozen.
debug.log:
[29-Jan-2015 15:45:00 UTC] PHP Fatal error: Cannot use object of type stdClass as array in /Users/example/Sites/example.com/wp-content/plugins/jetpack/modules/widget-visibility/widget-conditions.php on line 184
Thank you, I plan on looking into this next week.
I think I may have found the problem. The plugin wasn’t considering settings saved as multidimensional arrays like Jetpack Widget Visibility.
Can you please test by replacing includes/import.php with this? Only the importer has changed so you can re-import an old .wie file and the visibility settings should work.
https://raw.githubusercontent.com/stevengliebe/widget-importer-exporter/arraysfix/includes/import.php
This is what changed:
https://github.com/stevengliebe/widget-importer-exporter/commit/3ae03e6c4e6f4e5d3bf86d2ccb2627826a4e7f7b#diff-4c8185733e6c7647c6f5f966d9e4c9a2
You can use the Widget Reset then Remove Inactive Widgets plugins if you need to clear things out first (one of them generated a warning for me but still worked fine).
https://ww.wp.xz.cn/plugins/widgets-reset/
https://ww.wp.xz.cn/plugins/remove-inactive-widgets/
Hi Steven,
I had the same results. Received a notice message but otherwise everything appears to be working correctly:
Notice: Undefined index: title in /Users/example/Sites/example.com/wp-content/plugins/widget-importer-exporter/includes/import.php on line 271
Thanks for looking into this so quickly!
Hmm, a different error this time. Hopefully just a bug introduced during the fix.
Did the Visibility settings show up in your widget after importing?
Could you get in touch by email? http://stevengliebe.com/contact. If I can test with your .wie file and theme/plugins then I can see the same error and hopefully solve it once and for all.
Just sent off a message. The visibility settings did show up in my widgets after importing.
Thanks, will give your .wie a look
Thank you for reporting the but and testing the fix. Version 1.2 is available now.