Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#33 | views_bulk_operations_node_export_fails_with_undefined_function-1869918-33.patch | 2.83 KB | osman |
#28 | interdiff-1869918-19-28.txt | 425 bytes | thijsvdanker |
#28 | views_bulk_operations-1869918-28.patch | 2.34 KB | thijsvdanker |
#24 | screen_shot2.png | 11.99 KB | Nikolay Shapovalov |
#24 | screen_shot.png | 18.79 KB | Nikolay Shapovalov |
Comments
Comment #1
queenvictoria CreditAttribution: queenvictoria commentedPatch attached
Comment #2
rimen CreditAttribution: rimen commentedNew correct patch
Comment #3
kalis1I've tested the patch in #2 with success. Thank you rimen !
Comment #4
rooby CreditAttribution: rooby commentedThis 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.
Comment #5
chrisjlee CreditAttribution: chrisjlee commentedPatch #4 worked for me was well.
I'm unable to use the module without the patch. Please commit this patch
Comment #6
queenvictoria CreditAttribution: queenvictoria commentedThanks people for fixing my work on this. Love that.
Comment #7
KarlSheaThe same problem exists in 6.x, and the same solution fixes it.
Comment #8
muschpusch CreditAttribution: muschpusch commented+1 for committing this
Comment #9
steveaps CreditAttribution: steveaps commented#4 works for me, thanks for the patch
Comment #10
joshf CreditAttribution: joshf commented#4 fixed it for me as well, thanks @rooby
Comment #11
eriktoyra CreditAttribution: eriktoyra commentedI can also confirm that the patch in #4 solves the problem.
Comment #12
xbrianx CreditAttribution: xbrianx commentedFor 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).
Comment #13
caspervoogt CreditAttribution: caspervoogt commentedPath node_export-_views_bulk_operations_adjust_selection-1869918-4.patch works for me ..
Comment #14
kenorb CreditAttribution: kenorb commentedTested #4 and it works.
Please commit.
Comment #15
jeffschulerLike 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.
Comment #16
jeffschulerI 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, includingviews_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, (usingdpm()
anddd()
.)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()
.Comment #17
joshuautley CreditAttribution: joshuautley commentedtested #16 and it did not resolve the problem.
Comment #17.0
joshuautley CreditAttribution: joshuautley commentedUpdated issue link
Comment #18
alex.xequals CreditAttribution: alex.xequals commentedTried #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.
Comment #19
Ronino CreditAttribution: Ronino commentedFor me, #16 selects all rows every time, no matter if the respective checkbox is checked. I adapted the patch to fix that.
Comment #20
kevster CreditAttribution: kevster commentedMany 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
Comment #21
xbrianx CreditAttribution: xbrianx commentedSeems 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.
Comment #22
xbrianx CreditAttribution: xbrianx commentedIt 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.
Comment #23
Nicolas Bouteille CreditAttribution: Nicolas Bouteille commented#19 worked for me too!
Comment #24
Nikolay Shapovalov#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.
Comment #25
Traverus CreditAttribution: Traverus commentedI 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!!
Comment #26
joshf CreditAttribution: joshf commented@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??
Comment #27
Gabriel R. CreditAttribution: Gabriel R. commentedPatch #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
Comment #28
thijsvdanker CreditAttribution: thijsvdanker commentedI 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.
Comment #29
crucq CreditAttribution: crucq commented#28 works for me!
Thank you Thijs
Comment #30
MrPaulDriver CreditAttribution: MrPaulDriver commentedFirst 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.
Comment #31
osmanThe patch attached to #1869918-28: Views bulk operations node export fails with undefined function _views_bulk_operations_adjust_selection applies cleanly to 7.x-3.x and works. Thanks.
Comment #32
osmanChanging the status back to "Needs work".
I realized not all the instances of
variable_get('node_export_format', array('drupal'));
is updated.Comment #33
osmantrying again...
Comment #34
thijsvdanker CreditAttribution: thijsvdanker commentedPatch in #33 applies and works. Marking it RTBC!
Comment #35
keva CreditAttribution: keva commentedalso verified: patch #33 worked
Comment #36
rroblik CreditAttribution: rroblik commentedwhen patch #33 will be included in dev version ??
EDIT : no, in stable version, 2 years after !?
Thanks
Comment #37
kfrank CreditAttribution: kfrank commented#19 worked for me. I was getting the white screen of death. Thank you!
Comment #38
JKingsnorth CreditAttribution: JKingsnorth commented#33 worked for me so this is still RTBC!
Comment #39
tonylegrone CreditAttribution: tonylegrone commented#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...
Comment #40
rossb89 CreditAttribution: rossb89 commentedAnother confirmation, patch #33 solves the issue.
Comment #41
scotwith1tYet another confirmation. Patch is working and required for this module to work at all with VBO.
Comment #42
temkin CreditAttribution: temkin commentedSame issue. #33 fixed it.
Comment #43
rooby CreditAttribution: rooby commentedI think this meets the definition of critical.
Comment #44
rollingnet CreditAttribution: rollingnet commentedFix #33 works also for me.
IMO, it's time this patch should be apply.
Comment #45
mattyy21#33 Work. I have edit the .module
GIT here
https://github.com/mattyy21/node_export/tree/master
Comment #46
tengoku#33 worked for me... thanks!
Comment #47
lookatthosemoose CreditAttribution: lookatthosemoose commentedWe should try to get #33 in the dev version.
Comment #48
caspervoogt CreditAttribution: caspervoogt at Plethora commented#33 works for me.
Comment #49
fubarhouse CreditAttribution: fubarhouse commented#33 also works for me.
Comment #50
scotwith1tHope this helps someone else, but after stumbling across this yet again, 6 months later, I decided to go with Views Data Export instead. It offers more control over the data exported and is at least being actively maintained.
Comment #51
nwoodland CreditAttribution: nwoodland commented#33 worked great for me. Thanks everyone!
Comment #53
danielb CreditAttribution: danielb commentedComment #54
JKingsnorth CreditAttribution: JKingsnorth commented!!! Thanks for committing.
Comment #55
darrell_ulm CreditAttribution: darrell_ulm as a volunteer commented#33 works.