I'm trying to use VBO to 'Change affiliate publishing options' which comes with Domain Access. When I select any node and click 'Execute' I get a WSOD on the next page. I get a PHP error of 'PHP Fatal error: Unsupported operand types in blah/modules/views_bulk_operations.module on line 346.

I've tried it using the latest dev version also (dated May 6th) and it just changes the line the error is on.

I'm using Views version 2.10 though I noticed that it is actually '6.x-2.10-acquiadev-1' which must be a special update that the Acquia distribution uses. I'm not sure if that could make a difference or not.

The action does work correctly when I use it directly through the Domain Access system.

Any ideas? Thanks!

Comments

infojunkie’s picture

Does the same VBO work with any other operation? Does the stock VBO (admin/content/node2) work at all?

FunkMonkey’s picture

Status: Active » Closed (fixed)

Well, I can't even recreate my own error right now. I'm not sure if something happened since Friday but I will close this and will re-open if I can consistently recreate the problem. Sorry to waste your time!

hnln’s picture

Same problem here and unfortunately it didn't resolve itself. Other operations don't give any problem, only the Domain Access operation gives above error.

hnln’s picture

Status: Closed (fixed) » Active
mikeytown2’s picture

Project: Views Bulk Operations (VBO) » Domain
Version: 6.x-1.9 » 6.x-2.5
Component: Actions » - Domain Views

Moving this to the domain access project

mikeytown2’s picture

looking around; found this
#710712: How to change content affiliation for 1000+ nodes
Which points to this module if you want to use this action in VBO
http://drupal.org/project/domain_actions

agentrickard’s picture

Version: 6.x-2.5 » 7.x-3.x-dev
Category: bug » feature

DA 6.x does not support VBO. VBO doesn't use hook_node_operations the same way that core does. Domain Content is provided instead (and that module actually predates VBO).

agentrickard’s picture

Title: Unsupported operand types in blah/view_bulk_operations.module on line 346 » Support Views Bulk Operations
mikeytown2’s picture

Main issue here is the fact that there is an action, thus most people will try to use that action in VBO; like I did yesterday. Not sure how you want to go forward, just letting you know that you will get some support requests for this in the future if left in its current state.

agentrickard’s picture

We did, and we tried to resolve it in #710712: How to change content affiliation for 1000+ nodes and dropped it there. Feel free to re-open that patch for D6.

Personally, I think this is a bug in VBO, since it uses hook_node_operations() but does _not_ do it the way that core does.

infojunkie’s picture

@agentrickard, if you could explain what is the bug in VBO that prevents the DA node_operation from functioning correctly, maybe I could fix it.

agentrickard’s picture

The VBO submit operation is a multistep process, as I recall, and core's is not. That means that the form_alter() we use to add our settings to core don't work for VBO.

See the other issue for the long history.

agentrickard’s picture

Component: - Domain Views » Code

In Drupal 7, we can solve this with VBO's support for actions. Anyone care to code it?

fuse’s picture

subscribing

agentrickard’s picture

@fuse

Please use the "Follow" button to avoid spamming maintainers.

fearlsgroove’s picture

Status: Active » Needs review
StatusFileSize
new4.79 KB

Attached patch implements the required action to use with VBO. It includes some refactoring to allow re-use of the process node code, so the patch looks bigger than it really is.

fearlsgroove’s picture

StatusFileSize
new5.5 KB

Previous patch was missing domain_source integration.

fearlsgroove’s picture

Status: Needs review » Needs work

Domain source functions aren't firing since they're hooked into #validate and submit, which aren't in the same spot for the VBO form. Handling these with submit isn't going to work here because we want to use VBO's batch processing.

I see two possible workarounds:
* If relevant, call out into domain_source from the action in domain_content. This creates a loose circular dependency -- source integrates with content, but now content would optionally integrate with source. Fugly
* Refactor into a hook, which would expand the scope of this a bit. Seems a bit heavy handed

fearlsgroove’s picture

Status: Needs work » Needs review
StatusFileSize
new6.89 KB

This attempt skirts around the circular dep/implement hook question by making source and content two separate options. Much simpler to build but maybe not ideal from a UX perspective.

agentrickard’s picture

Not sure if there is anything to be done about that in VBO, though.

vlooivlerke’s picture

With the latest Dev of VBO there is an option in the view style of VBO under
>>Selected operations
>>>Change affiliate publishing options (domain_content_node_operations_process)
If I select a few nodes to execute and then select " Change affiliate publishing options" to execute in my view bulk operations it takes me to the following page and asks
>>Set parameters for Change affiliate publishing options
This page is empty and don't have any domain parameter options to select.
It only has a next button.

I ask this because your patch does not match over the new VBO dev version.

I seriously want to use views to update my domain publishing
If I would (and tried) to patch your patch what would I have to look out for to be able to use your approach?
Thanks

Edit+ I used D6

mxh’s picture

#19 - for which version is this patch actually? I am looking for a long time for Actions integration, but have no luck. ON Domain Actions module project page I cannot find any module to download.

agentrickard’s picture

Status: Needs review » Needs work

Flagging for re-roll against 7.x.3.

les lim’s picture

#19 still applies with offsets.

jawi’s picture

Can I use this with latest domain 7.x-3.x-dev version from 2013-Jan-28?

podarok’s picture

Status: Needs work » Needs review

status

mac_weber’s picture

Status: Needs review » Reviewed & tested by the community

patch on #19 still works

agentrickard’s picture

Looking at this after a long time away, I don't know that it is proper to put this integration into Domain Content. That module both predates VBO and works around its limitations.

VBO integration for changing domains should likely be supported directly in the main module.

agentrickard’s picture

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

The logic for assignment is all in domain content. Would the plan be to deprecate domain content completely? Otherwise it's quite a bit of surgery and/or code duplication, and a considerable expansion of a fairly narrow change.

Domain content exists to provide batch management for content domain assignment, so this stuff makes sense to me here unless you plan to deprecate domain content completely ( I think? It's been a while since I looked at it).

agentrickard’s picture

Domain Content predates VBO, which is why we have the code duplication. It also removes any dependency on Views.

IMO, if people want to build an alternative using Views and VBO, they should not be using Domain Content.

davidwhthomas’s picture

Not sure if relevant but domain_rules provides rules which are available for VBO, they just need to be added as an action to a rules "component".

  • rules_action_create_domain - create new domain using given arguments
  • rules_action_delete_domain - delete existing domain
  • rules_action_set_user_defaults_domain - set a given role access to a given domain
  • rules_action_set_user_domain - set domain to a user
  • rules_action_set_node_domain - set domain to a node
  • rules_action_set_domain_theme - set a theme to a given domain

e.g, exported rule component to set user domain ( www.example.com )

{ "rules_assign_user_to_domain" : {
    "LABEL" : "Assign user to domain",
    "PLUGIN" : "rule",
    "TAGS" : [ "domain" ],
    "REQUIRES" : [ "domain_rules" ],
    "USES VARIABLES" : { "user" : { "label" : "Users", "type" : "list\u003Cuser\u003E" } },
    "DO" : [
      { "LOOP" : {
          "USING" : { "list" : [ "user" ] },
          "ITEM" : { "list_item" : "Current list item" },
          "DO" : [
            { "domain_rules_action_set_user_domain" : { "subdomain" : "www.example.com", "user" : [ "list-item" ] } }
          ]
        }
      }
    ]
  }
}
petednz’s picture

dave - thanks for sharing that - saved me a bunch of time or a work around or just giving up

given this is to help us assign users to domains - is it more than a trivial fix to have a parameter (?) instead of the hard coded domain url - so available domains are offered via the VBO UI?

fearlsgroove’s picture

Issue summary: View changes

Here's a reroll, still putting the update logic in domain_content. @agentrickard: Would you prefer that the affiliate form assignment code be moved into domain.module (along with the VBO specific stuff)?

fearlsgroove’s picture

StatusFileSize
new7.23 KB

Oops ... patch

theroyal’s picture

I need to bulk update of domain source field for about 70,000 nodes,
will this patch help ?
am using latest version of DA and VBO and domain VBO

fearlsgroove’s picture

I wouldn't try to do anything on 70k nodes using the browser/batch API. A drush script is probably a better idea if that's possible. That said, theoretically, yes, you could apply this patch, create a view with bulk operations filtered to the nodes you want to change, add the change domain source option and go to town. Test on a local/dev site first.

jweirather’s picture

I left a note on another thread about this. Look at the Domain Migrate module. https://www.drupal.org/project/domain_migrate

bbc’s picture

Thanks fearlsgroove. The patch in #35 worked quite nicely for me.

podarok’s picture

Just a small addition.

+++ b/domain_source/domain_source.module
@@ -290,21 +290,28 @@ function domain_source_update_nodes($form, &$form_state) {
+  db_insert('domain_source')

It is better to use db_merge, I guess
Anyway - it is ok to merge.

dasjo’s picture

Status: Needs review » Needs work

the latest patch contains a dpm statement

artem.vilkov’s picture

StatusFileSize
new7.15 KB
mgifford’s picture

Status: Needs work » Needs review

No dpm() in #42

bluegeek9’s picture

Status: Needs review » Closed (outdated)

Drupal 7 in End of Life and no longer supported. We encourage you to upgrade to a supported version of Drupal. For more information, see https://www.drupal.org/upgrade.

//www.flaticon.com/free-icons/thank-you Thank you for your contribution! Your continued support of this project makes other volunteer contributions more sustainable.
There are multiple ways to show appreciation for the work contributed to this project, including:
  • Triaging issues and adding more context to existing issues.
  • Writing documentation or patches for this project.