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.
Within views_bulk_operations_action_load_list()
, a call is made to views_bulk_operations_handler_field_operations::getValue()
. However, views_bulk_operations_handler_field_operations
now extends views_handler_field_entity
, and views_handler_field_entity::getValue()
behaves differently than views_handler_field::getValue()
. This difference causes views_bulk_operations_action_load_list()
to error out.
Comment | File | Size | Author |
---|---|---|---|
#8 | 2853029-8.patch | 848 bytes | joelpittet |
#2 | 2853029-01.patch | 889 bytes | pjohn |
Comments
Comment #2
pjohn CreditAttribution: pjohn as a volunteer commentedI made this patch based on the strategy that was used in
views_bulk_operations.drush.inc
. See if it addresses the problem.Comment #3
joelpittetDo you happen to know when that handler's getValue() changed output? or did it?
Comment #4
pjohn CreditAttribution: pjohn as a volunteer commentedjoelpittet, I don't think the issue is that getValue() changed. It's that
views_bulk_operations_handler_field_operations
used to extendviews_handler_field
, but now it extendsviews_handler_field_entity
.views_handler_field_entity::getValue()
works differently thanviews_handler_field::getValue()
, and I suspect maybe the developers missed one spot where that change had to be accounted for.Comment #5
joelpittetI know there is no automated tests for VBO but could you tell me the steps to reproduce in the simpliest case and I'll do that manually and step through to ensure the change fixes the issue. Then commit it.
Comment #6
joelpittetComment #7
pjohn CreditAttribution: pjohn as a volunteer commentedSteps to reproduce:
test_vbo_patch
). Give the view a page display and format as a table of fields.devel/php
). Enter the following code:If the patch works, the script will execute and display an array containing an EntityListWrapper. It should fail the way the module currently is.
Comment #8
joelpittetThanks @pjohn, that looks like the original intent is to get the entity to avoid loading a new one from the ID and having a double database hit. How about we do that as a fallback?
Comment #9
joelpittetWill this do the trick?
Comment #10
tobiasbFor me the trick does it.
Comment #11
joelpittetFeel free to set the status to RTBC and I'll commit this to -dev
Comment #12
nairb CreditAttribution: nairb commentedWorks for me too. Thanks!
Comment #14
joelpittetThank you, I've committed this to the -dev branch.
Comment #15
tobiasbI believe the root problem is, when you do not have declare the 'entity type' in hook_views_data().
VBO do not provide anymore the field in views -> you can not see the view anymore in select list in rules.
And you got a Fatal error:
Fatal error: Call to a member function get_entity_type() on a non-object in /var/www/html/web/sites/all/modules/contrib/views_bulk_operations/views_bulk_operations.rules.inc on line 173
when you define the type, then all is fine. Views/Rules works again.
Comment #16
joelpittet@tobiasb if that is something you are still getting can you open a new issue with the steps to reproduce?
Comment #17
pjohn CreditAttribution: pjohn as a volunteer commentedThanks @joelpittet; I haven't checked this thread in a few days, but I like your solution.
Comment #19
joelpittetLooks related to #1334374: Re-use generic entity views table
Comment #20
marco.b CreditAttribution: marco.b as a volunteer commentedAfter updating to the current dev version = "7.x-3.4+9-dev" all works fine. As this is a major bug I strongly recommend to include the fix into a new stable version as soon as possible.
Comment #21
RedEight CreditAttribution: RedEight at 95Visual commentedWould like to see this in a stable release. I was very confused when the entity id fetch in rules worked but the entity fetch was not.
Comment #22
joelpittetWaiting for a resolution to this #2856944: 'Please select at least one item' - after upgrading to 7.x-3.4 before a new release but I'll create a new release and let them sort that out. Please help if you can.
Comment #23
drunkencelt CreditAttribution: drunkencelt as a volunteer commentedHI,
I'm afraid the commit at #13 which is included in 7.x-3.4+9-dev has not solved my problem. (Core 7.54, Rules 7.x-2.10, Views 7.x-3.16)
I still do not get a list of VBO views showing in the drop-down field in either of the actions 'Load a list of entity ids from a VBO View' or 'Load a list of entity objects from a VBO View' when using 7.x-3.4+9-dev or 7.x-3.4.
If I revert to 7.x-3.3 I get all my VBO views showing up in the drop-down but no values are returned by either action similar to #2862858: Rule action "Load a list of entity IDs from a VBO view" returns list with empty values.
In issue #2862858, patch #7 reportedly fixes the view list drop-down issue for the views_bulk_operations_action_load_id_list (it doesn't for me) and refers to the patch on this thread to resolve the same issue for views_bulk_operations_action_load_list (now included in 7.x-3.4+9-dev, but again this does not work for me).
Not quite sure what is going on here as on each occasion I make sure the modules are installed/reinstalled and clear caches numerous times. I also delete and recreate the VBO field in my test view just in case the VBO field isn't working properly between changes.
Not sure if this helps anyone to figure it out. The only thing left for me to try is to revert back to 7.x-3.3 and Views 3.15 as everything was working properly when I set it all up a good few months back.
Comment #24
joelpittetCan you open a new issue for your problem @drunkencelt? I think your issue is related to this one, so please apply the patch against -dev
#2856944: 'Please select at least one item' - after upgrading to 7.x-3.4
I'd like to roll out another release to fix this one soon.
Comment #25
webservant316 CreditAttribution: webservant316 commentedwhen is the new release due?
Comment #26
joelpittetHopefully after the issue I mentioned in #24 is reviewed and tested.
Comment #27
adrianavaz CreditAttribution: adrianavaz commentedHi,
I was having this problem too. Patch #8 worked for me.
Thanks
Comment #28
jweirather CreditAttribution: jweirather commentedSame issue here, I used drush to update to the dev version, issue resolved. Thanks all.
Comment #29
maxplus CreditAttribution: maxplus commentedThanks,
Patched current 3.4 and it works again for me!
Comment #30
butterwise CreditAttribution: butterwise commentedFWIW, upgrading to latest dev resolved this problem for me, as well.