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

Patch attached

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

New correct patch

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

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.

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

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

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

+1 for committing this

#4 works for me, thanks for the patch

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

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

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).

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

Tested #4 and it works.
Please commit.

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.

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().

tested #16 and it did not resolve the problem.

Issue summary:View changes

Updated issue link

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.

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