When I export the menu with the argument --export-options throw me this Fatal error:
PHP Fatal error: Cannot unset string offsets in /var/www/tutoriame/sites/all/modules/contrib/menu_import/includes/export.inc on line 176
PHP Stack trace:
PHP 1. {main}() /usr/share/php/drush/drush.php:0
PHP 2. drush_main() /usr/share/php/drush/drush.php:16
PHP 3. _drush_bootstrap_and_dispatch() /usr/share/php/drush/drush.php:61
PHP 4. drush_dispatch() /usr/share/php/drush/drush.php:92
PHP 5. call_user_func_array() /usr/share/php/drush/includes/command.inc:182
PHP 6. drush_command() /usr/share/php/drush/includes/command.inc:182
PHP 7. _drush_invoke_hooks() /usr/share/php/drush/includes/command.inc:214
PHP 8. call_user_func_array() /usr/share/php/drush/includes/command.inc:362
PHP 9. drush_menu_import_export() /usr/share/php/drush/includes/command.inc:362
PHP 10. menu_import_export_menu() /var/www/tutoriame/sites/all/modules/contrib/menu_import/menu_import.drush.inc:235
PHP 11. _menu_import_export_recurse() /var/www/tutoriame/sites/all/modules/contrib/menu_import/includes/export.inc:129
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Cannot unset string offsets in /var/www/tutoriame/sites/all/modules/contrib/menu_import/includes/export.inc,
line 176| Comment | File | Size | Author |
|---|---|---|---|
| #11 | menu_import-check_options-2254111-11.patch | 682 bytes | eli-t |
| #10 | menu_import_check_options_2254111.patch | 575 bytes | a.milkovsky |
Comments
Comment #1
lukio commentedI comment some lines of the code and fix the problem. I upload the patch.
Please, take a look and let me know if it's ok.
Comment #2
a.milkovskyI confirm it. You can even delete these lines as they don't make any sense.
"If something is empty - than remove it."
Comment #3
lukio commented+1 a.milkovsky
Comment #4
lukio commentedComment #5
lex0r commentedThe lines do make sense, since
emptywill work for an empty array. However, this is not guaranteed, so I'd adjust the check to be:Comment #6
a.milkovskyI agree, makes sense, could you commit it?
Comment #7
pietrocap commentedHi,
applying changes in #5 fix the error in my case :-)
Comment #8
eli-tFixed a similar issue with me, first noticed in 7.x-1.6 when exporting through the GUI, would receive a 500 error when 'Export menu item options' selected.
Stack trace
[Tue Jun 24 12:12:17 2014] [error] [client 127.0.0.1] PHP Fatal error: Cannot unset string offsets in /Users/eli/Sites/sis2/sites/all/modules/contrib/menu_import/includes/export.inc on line 176, referer: https://sis2.dev/admin/structure/menu/export
[Tue Jun 24 12:12:17 2014] [error] [client 127.0.0.1] PHP Stack trace:, referer: https://sis2.dev/admin/structure/menu/export
[Tue Jun 24 12:12:17 2014] [error] [client 127.0.0.1] PHP 1. {main}() /Users/eli/Sites/sis2/index.php:0, referer: https://sis2.dev/admin/structure/menu/export
[Tue Jun 24 12:12:17 2014] [error] [client 127.0.0.1] PHP 2. menu_execute_active_handler() /Users/eli/Sites/sis2/index.php:21, referer: https://sis2.dev/admin/structure/menu/export
[Tue Jun 24 12:12:17 2014] [error] [client 127.0.0.1] PHP 3. call_user_func_array:{/Users/eli/Sites/sis2/includes/menu.inc:517}() /Users/eli/Sites/sis2/includes/menu.inc:517, referer: https://sis2.dev/admin/structure/menu/export
[Tue Jun 24 12:12:17 2014] [error] [client 127.0.0.1] PHP 4. drupal_get_form() /Users/eli/Sites/sis2/includes/menu.inc:517, referer: https://sis2.dev/admin/structure/menu/export
[Tue Jun 24 12:12:17 2014] [error] [client 127.0.0.1] PHP 5. drupal_build_form() /Users/eli/Sites/sis2/includes/form.inc:130, referer: https://sis2.dev/admin/structure/menu/export
[Tue Jun 24 12:12:17 2014] [error] [client 127.0.0.1] PHP 6. drupal_process_form() /Users/eli/Sites/sis2/includes/form.inc:385, referer: https://sis2.dev/admin/structure/menu/export
[Tue Jun 24 12:12:17 2014] [error] [client 127.0.0.1] PHP 7. form_execute_handlers() /Users/eli/Sites/sis2/includes/form.inc:903, referer: https://sis2.dev/admin/structure/menu/export
[Tue Jun 24 12:12:17 2014] [error] [client 127.0.0.1] PHP 8. menu_import_export_form_submit() /Users/eli/Sites/sis2/includes/form.inc:1513, referer: https://sis2.dev/admin/structure/menu/export
[Tue Jun 24 12:12:17 2014] [error] [client 127.0.0.1] PHP 9. menu_import_export_menu() /Users/eli/Sites/sis2/sites/all/modules/contrib/menu_import/includes/export.inc:93, referer: https://sis2.dev/admin/structure/menu/export
[Tue Jun 24 12:12:17 2014] [error] [client 127.0.0.1] PHP 10. _menu_import_export_recurse() /Users/eli/Sites/sis2/sites/all/modules/contrib/menu_import/includes/export.inc:129, referer: https://sis2.dev/admin/structure/menu/export
Seems to work fine with the patch #2.
Comment #9
eli-tComment #10
a.milkovskyas was mentioned in #5 we don't need to remove this string. We need only to add additional check.
I re-rolled the patch using #5.
Comment #11
eli-tApologies, missed that. Now it does look good :)
If we want to fix the coding standards violation on the following line too we could use the patch attached to this comment: https://www.drupal.org/files/issues/menu_import-check_options-2254111-11...
Comment #12
lukio commented+1 patch #11
Comment #13
a.milkovskyreviewed
Comment #14
jhubley commentedPatch in #11 worked great. +1
Comment #15
lex0r commentedFixed in 7.x-1.x
Comment #18
francescosciamanna commented#11 fixed my problem too. thx!