views_bulk_operations_node_export_fails_with_undefined_function-1869918-33.patch 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. diff --git a/node_export.module b/node_export.module
  2. index 8bdadb9..052fa6c 100755
  3. --- a/node_export.module
  4. +++ b/node_export.module
  5. @@ -38,7 +38,7 @@ function node_export_menu() {
  6. 'description' => 'Configure the settings for Node export.',
  7. 'file' => 'node_export.pages.inc',
  8. );
  9. - $selected_formats = variable_get('node_export_format', array('drupal'));
  10. + $selected_formats = variable_get('node_export_format', array('drupal' => 'drupal'));
  11. if (count(array_filter($selected_formats)) > 1) {
  12. $format_handlers = node_export_format_handlers();
  13. foreach ($format_handlers as $format_handler => $format) {
  14. @@ -218,7 +218,7 @@ function node_export_node_operations() {
  15. $operations = array();
  16. if (user_access('export nodes')) {
  17. - $selected_formats = variable_get('node_export_format', array('drupal'));
  18. + $selected_formats = variable_get('node_export_format', array('drupal' => 'drupal'));
  19. if (count(array_filter($selected_formats)) > 1) {
  20. $format_handlers = node_export_format_handlers();
  21. foreach ($format_handlers as $format_handler => $format) {
  22. @@ -258,7 +258,7 @@ function node_export_bulk_operation($nodes = NULL, $format = NULL, $delivery = N
  23. function node_export_action_info() {
  24. $actions = array();
  25. if (user_access('export nodes')) {
  26. - $selected_formats = variable_get('node_export_format', array('drupal'));
  27. + $selected_formats = variable_get('node_export_format', array('drupal' => 'drupal'));
  28. $format_handlers = node_export_format_handlers();
  29. foreach ($format_handlers as $format_handler => $format) {
  30. if (!empty($selected_formats[$format_handler])) {
  31. @@ -296,10 +296,13 @@ function node_export_action_info() {
  32. function node_export_action_form($context, &$form_state, $format = NULL) {
  33. // Get the name of the vbo views field
  34. $vbo = _views_bulk_operations_get_field($form_state['build_info']['args'][0]);
  35. +
  36. // Adjust the selection in case the user chose 'select all'
  37. - _views_bulk_operations_adjust_selection($form_state['selection'], $form_state['select_all_pages'], $vbo);
  38. + if (!empty($form_state['select_all_pages'])) {
  39. + views_bulk_operations_direct_adjust($form_state['selection'], $vbo);
  40. + }
  41. $nodes = array_combine($form_state['selection'], $form_state['selection']);
  42. - return node_export_bulk_operation($nodes);
  43. + return node_export_bulk_operation($nodes, $format);
  44. }
  45. /**
  46. @@ -347,7 +350,7 @@ function node_export($nids, $format = NULL, $msg_t = 't') {
  47. // Get the node code from the format handler
  48. $format_handlers = node_export_format_handlers();
  49. - $node_export_format = variable_get('node_export_format', array('drupal'));
  50. + $node_export_format = variable_get('node_export_format', array('drupal' => 'drupal'));
  51. $format_handler = $format ? $format : reset($node_export_format);
  52. if (!isset($format_handlers[$format_handler])) {
  53. $format_handler = 'drupal';