Steps to reproduce

  • Install and configure node export
  • Create a view and add bulk operations
  • Add node export to bulk operations list
  • Visit the view, select some nodes and choose "Node export" from the operations menu

Expected result

Export file and textarea

Actual result

Error 500 with logs

[Wed Dec 19 12:08:15 2012] [error] [client 127.0.0.1] PHP Fatal error:  Call to undefined function _views_bulk_operations_adjust_selection() in [...]/modules/contrib/node_export/node_export.module on line 300

Modules and versions

  • node_export 7.x-1.x-dev
  • Views (views) 7.x-3.5
  • Views Bulk Operations (views_bulk_operations) 7.x-3.1

Whats going on?

VBO has updated their code base (commit 6db047f9c59ab368846dbf5f169dcae581fed74a to fix #1367644) and the function no longer exists. The most similarly named function (views_bulk_operations_adjust_selection) has vastly different arguments and causes further errors. A similar function (views_bulk_operations_direct_adjust) takes similar arguments. I'm not sure if its a feature-for-feature migrate but it seems to be working ok (not fully tested).

(simple) Patch to follow.

Comments

queenvictoria’s picture

Patch attached

rimen’s picture

Version:7.x-3.x-dev» 7.x-3.0
Status:Active» Needs review
StatusFileSize
new1.25 KB

New correct patch

kalis1’s picture

I've tested the patch in #2 with success. Thank you rimen !

rooby’s picture

Version:7.x-3.0» 7.x-3.x-dev
Priority:Normal» Major
StatusFileSize
new1.29 KB

This patch is the same as #2 but rolled from the node_export directory.

Fixes the problem for me.

Marking major as I cannot use the module otherwise.

chrisjlee’s picture

Status:Needs review» Reviewed & tested by the community

Patch #4 worked for me was well.

I'm unable to use the module without the patch. Please commit this patch

queenvictoria’s picture

Thanks people for fixing my work on this. Love that.

KarlShea’s picture

The same problem exists in 6.x, and the same solution fixes it.

muschpusch’s picture

+1 for committing this

steveaps’s picture

#4 works for me, thanks for the patch

joshf’s picture

#4 fixed it for me as well, thanks @rooby

eriktoyra’s picture

I can also confirm that the patch in #4 solves the problem.

xbrianx’s picture

For me it seems to work somewhat.. In views bulk operations you have the ability to select all nodes instead of what is just displayed, but the export seemed to be still limited to 50 (which was on the view) even though there were more nodes than that.

Sometimes I will get the following error after clicking the export button (it will start out looking ok then error):

Notice: Undefined variable: nids in node_export_gui() (line 332 of /home/site/public_html/site/sites/all/modules/node_export/node_export.pages.inc).
Notice: Undefined variable: code_string in node_export_gui() (line 332 of /home/site/public_html/site/sites/all/modules/node_export/node_export.pages.inc).

Also after applying the patch I am randomly getting these errors as well:

Notice: Undefined variable: nids in node_export_gui() (line 332 of /home/site/public_html/site/sites/all/modules/node_export/node_export.pages.inc).
Notice: Undefined variable: code_string in node_export_gui() (line 332 of /home/site/public_html/site/sites/sites/all/modules/node_export/node_export.pages.inc).
Warning: implode() [function.implode]: Invalid arguments passed in node_export_get_file() (line 440 of home/site/public_html/site/sites/sites/all/modules/node_export/node_export.pages.inc).
Notice: Undefined index: in node_export_get_file() (line 447 of home/site/public_html/site/sites/sites/all/modules/node_export/node_export.pages.inc).

caspervoogt’s picture

Path node_export-_views_bulk_operations_adjust_selection-1869918-4.patch works for me ..

kenorb’s picture

Tested #4 and it works.
Please commit.

jeffschuler’s picture

Status:Reviewed & tested by the community» Needs work

Like mentioned in #12, I'm also seeing that the patch in #4 does not work when choosing to extend the selection to all pages of the view. Only the current page of selections is exported.

jeffschuler’s picture

Status:Needs work» Needs review
StatusFileSize
new1.24 KB

I don't think the views_bulk_operations_execute() in the patch in #4 is having much, if any, effect. I see the batch operations being queued up, including views_bulk_operations_adjust_selection, showing the right new number of total rows (with selection expanded to all pages,) but I don't see the batch ops actually being called, (using dpm() and dd().)

At any rate, rows on all pages were not being exported -- only the current page.

The attached patch is successfully selecting all rows. It's using the views_bulk_operations_direct_adjust() function, which seems to be the new (though deprecated) incarnation of _views_bulk_operations_adjust_selection().

joshuautley’s picture

tested #16 and it did not resolve the problem.

joshuautley’s picture

Issue summary:View changes

Updated issue link

alex.xequals’s picture

Issue summary:View changes

Tried #2, #4, and #16, and none of them worked. Still getting the same error message on line 300. Until this is fixed, the module is useless for bulk exports.

Ronino’s picture

For me, #16 selects all rows every time, no matter if the respective checkbox is checked. I adapted the patch to fix that.

kevster’s picture

Many thanks @Ronino - I can confirm that your updated patch works and only exports what I select in VBO, also the orig error has been fixed:

views 7.x-3.5
VBO 7.x-3.1
node_export 7.x-3.0

xbrianx’s picture

Seems like i ran into this error yet again on another project. Every time i tried to export I would get a white screen of death. I applied the patch in #19 and it works. Thanks.

xbrianx’s picture

It worked for me with one content type, then on another content type it looks like I am getting errors related to this issue: https://drupal.org/node/1100024 i don't know if it is related though.

Nicolas Bouteille’s picture

Status:Needs review» Reviewed & tested by the community

#19 worked for me too!

zniki.ru’s picture

StatusFileSize
new18.79 KB
new11.99 KB

#19 resolve problem with _views_bulk_operations_adjust_selection();
But I try to export in DSV, and I get Drupal var format.

Maybe it's another issue.
Here is a screenshot:

I've found, if i use VBO to export nodes. It's ignore value of format in Views filter.
And just export data to format, which highest of enabled on node_export modules settings page (/admin/config/content/node_export).
So to export node in DSV, I enable only DSV in node_export module settings.

Traverus’s picture

I don't mean to be pushy but why the heck isn't this committed yet? This makes the VBO functionality completely unusable and it's been open for 2 years!!

joshf’s picture

@Traverus this issue has been open for two years, but only been RTBC for a month. The node_export project is seeking co-maintainers, perhaps you can help??

Gabriel Radic’s picture

Patch #19 doesn't fix the error undefined function _views_bulk_operations_adjust_selection with VBO.

Edit: A more detailed error spit by Drupal when batch mode is enabled in the Views settings:

Missing argument 4 for views_bulk_operations_adjust_selection(), called in /…/sites/all/modules/node_export/node_export.module on line 304 and defined dans views_bulk_operations_adjust_selection() (line 847 in /…/sites/all/modules/views_bulk_operations/views_bulk_operations.module

thijsvdanker’s picture

Status:Reviewed & tested by the community» Needs review
StatusFileSize
new2.34 KB
new425 bytes

I had the same issue as #24; it was exporting in 'drupal' format regardless of what was selected.
Updated the patch from #19 to make other formats (e.g. dsv) working again.

crucq’s picture

#28 works for me!
Thank you Thijs

MrPaulDriver’s picture

First time I have used this and I was just getting a blank screen where the exported code should have appeared. Patch in #28 fixes it for me.

osman’s picture

Status:Needs review» Reviewed & tested by the community
osman’s picture

Status:Reviewed & tested by the community» Needs work

Changing the status back to "Needs work".
I realized not all the instances of

<?php
 variable_get
('node_export_format', array('drupal'));
?>

is updated.

osman’s picture

Status:Needs work» Needs review
StatusFileSize
new2.83 KB

trying again...

thijsvdanker’s picture

Status:Needs review» Reviewed & tested by the community

Patch in #33 applies and works. Marking it RTBC!

keva’s picture

also verified: patch #33 worked

rroblik’s picture

when patch #33 will be included in dev version ??

EDIT : no, in stable version, 2 years after !?

Thanks

kfrank’s picture

#19 worked for me. I was getting the white screen of death. Thank you!

JKingsnorth’s picture

#33 worked for me so this is still RTBC!

tonylegrone’s picture

#33 isn't applying for me :(

EDIT: Never mind. I confused myself and was trying to apply the patch to views_bulk_operations instead of node_export. Long day...

rossb89’s picture

Another confirmation, patch #33 solves the issue.

scotself’s picture

Yet another confirmation. Patch is working and required for this module to work at all with VBO.

temkin’s picture

Same issue. #33 fixed it.

rooby’s picture

Priority:Major» Critical

I think this meets the definition of critical.