Closed (outdated)
Project:
Domain
Version:
7.x-3.10
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
10 Feb 2010 at 21:26 UTC
Updated:
2 May 2025 at 12:36 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
agentrickardDomain Content already lets you do 50 at a time.
The D6 version is closed to new feature requests. A small helper module would probably achieve this integration.
Comment #2
agentrickardHere's a small pseudo-patch that I might consider. This is in Domain Content module, and should open its node operations to other modules.
Comment #3
fizk commentedWith this patch, I don't see domain content's operations show up under /admin/content/node2. I'll try to help with this.
Comment #4
agentrickard/admin/content/node2 ?? What module sets that path?
Note that you still need the 'set domain access' permission for the form element to appear.
Comment #5
agentrickardOh, that patch just adds the operation. You would still need the form selection element, and it is not clear to me how to add that to any form.
And this is why we already provide this feature in Domain Content.
Comment #6
fizk commentedTo make the operation show up under Bulk Operations drop down list, I had to edit the view:
Style -> Bulk Operations (configuration wheel) -> scroll down to "Selected operations" -> check "Change affiliate publishing options (domain_content_node_operations_access)"
Edit:
Need to add the domain content form and we'll be done.
Comment #7
agentrickardYes, but how? Is that form (from VBO) consistently named?
Just having the operation doesn't do anything.
Comment #8
agentrickardI can't make VBO work. I get this stupid error when trying to add the new operation.
Comment #9
agentrickardEven so, give this a shot. Apply from the domain root dir.
Comment #10
agentrickardLast patch forgot to set option properly.
Comment #11
fizk commentedNice! The publishing options are empty though:
Publishing options:
[x] Send to all affiliates
Select if this content can be shown to all affiliates. This setting will override the options below.
Publish to:
Select which affiliates can access this content.
Comment #12
agentrickardTry the second patch, in #10.
Comment #13
fizk commentedSeems like it's not saving the changes, though.
1. I'm trying to make all my content affiliated with the main page, and nothing else. Hence, "Content for all affiliate sites" page should be empty. I thought I could do this by unchecking "Send to all affiliates" and checking "Publish to: ", but it didn't work in either VBO _or_ the "Content for all affiliate sites" page.
2. Changing a single node to non-main site X doesn't show up under /admin/domain/content/3
Comment #14
fizk commentedAs I suspected, the normal /admin/domain/content pages work just fine.
Comment #15
fizk commentedI think the problem is that domain_content_update_nodes(...) isn't being called. VBO calls domain_content_node_operations_access(...), and that's it.
domain_content_update_nodes() is supposed to be called by #submit when domain_content_form(...) returns a form.
Comment #16
fizk commentedDoes #submit survive the confirmation step? VBO's confirmation step looks like:
Are you sure you want to perform 'Change affiliate publishing options' on selected rows?
You selected the following 1 rows:
* my test node
[ Confirm ] Cancel
Comment #17
fizk commentedHere's more info
If I add
$form['#submit'][] = 'domain_content_test';to the end ofdomain_content_add_form_widget(...), the test function is called on the _confirmation page_, not after the confirmation page has been submitted.Comment #18
fizk commentedIf you're on IRC, let's talk in Freenode #drupal, I'm fizk_.
Comment #19
agentrickardI think your point in #15 is correct. In our normal usage, that callback is all we need. In VBO cases, we probably need a different callback.
Of course, I can't get VBO to _work_ with Views 6.x.2.8...
Comment #20
agentrickardComment #21
fizk commentedAre you running Firefox? The screenshot looks like Safari, maybe that page is broken in Safari.
Comment #22
agentrickardFirefox (3.5 on OS X). It's a form element thing. It says to edit the fields, but no fields are shown.
Comment #23
fizk commentedTrying to get more help: #712912: Integration with Domain Access
Similar bug report: #505466: Extending hook_node_operations for supporting forms.
Comment #24
fizk commentedMaybe try adding the widget form to the confirmation page instead of the selection page?
Comment #25
agentrickardMaybe... Can you try?
Comment #26
fizk commentedI'm very close to finishing it, using
http://drupalcontrib.org/api/function/_views_bulk_operations_action_form/6
http://drupalcontrib.org/api/function/_views_bulk_operations_action_subm...
Comment #27
fizk commentedDone! Will upload the patch in a few minutes :)
Comment #28
fizk commentedPatched against unmodified 6.x-2.1
Comment #29
agentrickardTagging.
Comment #30
nonsieI'm getting the following error with the patch in #28:
Parameter 1 to domain_content_node_operations_access_submit() expected to be a reference, value given in views_bulk_operations\views_bulk_operations.module on line 901.
Also I cannot make any changes to affiliates using VBO.
Comment #31
fizk commentedWhat version of VBO are you running? I have 6.x-1.9.
domain_content_node_operations_access_submit() processes the submission. When we fix this, your changes to affiliates will be saved.
Comment #32
nonsieI have 6.x-1.9 as well.
The line 901 in VBO is
while domain_content_node_operations_access_submit uses &$form and &$form_values.
Comment #33
fizk commentedIf you have devel module, can you dpm($form), or just var_dump($form).
Comment #34
nonsiePatch against DRUPAL-6--2 attached.
Comment #35
fizk commentedWhat was the problem?
Comment #36
nonsiedomain_content_node_operations_access_submit was using reference while it needs to use value.
Comment #37
fizk commentedIt's faster to use references, and why isn't it breaking for me?
Comment #38
nonsieWhich PHP version are you running? Mine is 5.3.1
Comment #39
fizk commentedAh, I have 5.2.12....maybe that's why.
Comment #40
agentrickardLet's be sure that none of this breaks Domain Content. I also wonder if we can expose this to VBO directly in domain.module, so people wouldn't need to use Domain Content unless they wanted to.
Comment #41
Silicon.Valet commentedack... broken again in 6.24 why was this not added to HEAD?
Comment #42
agentrickardDID YOU REVIEW THE PATCH?
NO. YOU DIDN'T.
So you have no grounds to complain. And you're being offensive.
Read the thread. The two maintainers cannot make VBO work properly, so we cannot commit the patch, because we can't even verify that it works.
And it's not broken "again". The functionality does not currently exist. Domain Content _predates_ VBO.
Either help or leave.
Comment #43
fizk commentedLike I said before, the patch works for me.
nonsie had a problem and fixed it in #34.
agentrickard: can you find a nice soul to test this patch and tell us if there are problems?
Comment #44
agentrickardAnd the questions in #40?
Comment #45
agentrickardThe function domain_content_node_operations_access_submit() is just plain wrong. It processes when the confirm form is loaded, not when it is submitted.
Comment #46
agentrickardHere's the current patch against 6--2, which fixes everything (?) except the error in
domain_content_node_operations_access_submit().Works with Domain Content, the normal Node admin form, and VBO. Though the VBO confirm operation is broken.
Comment #47
agentrickardI would also greatly prefer to _remove_ the broken intermediate step in the VBO process and simply add the DA form elements directly to the selection form, as it's done in the other two cases.
Comment #48
agentrickardAnd why are the arguments wrong? domain_content_node_operations_access_submit($form, $form_values)? That's D5 syntax.
This was a very sloppy patch.
domain_content_node_operations_access_submit needs to be removed and made to work with domain_content_update_nodes(). The duplicate code is painful.
Comment #49
Silicon.Valet commentedwow, hit a nerve here. Didn't mean to be offensive. The patch above DID work for me in 6.21 without any trouble. I was not being accusatory, merely asking why it wasn't added in. As I said, it does work for me in 6.21, just not in 6.24. I'm sorry for coming off badly.
Comment #50
agentrickardWell, the patch has known bugs in it, and is not ready for production. The patch in #48 should apply to 6.x.2.4, so give it a try.
Watch what happens, however, if you hit 'Cancel' on a VBO operation. The changes still get saved. That's a bad oversight.
Part of my frustration here is that 6.x is essentially closed to new features. I'm considering an exception here, and doing extra work. So hollow complaints just don't cut it.
Comment #51
fizk commentedrickard, how do you generate your patches? "710712-domain-DRUPAL-6--2.patch" sounds like it was autogenerated
Comment #52
fizk commentedThe problem with the Cancel button is that we have already changed the domain by the time the user lands on the confirmation page.
We should relying on
_views_bulk_operations_action_submitto call our callback function,domain_content_node_operations_access_form.http://drupalcontrib.org/api/function/_views_bulk_operations_action_subm...
Comment #53
fizk commentedwaiting for reply here: http://drupal.org/node/712912
Comment #54
nonsiere #51 - most developers create patches in issue_number + module_name + branch_version format to keep track of the patches - which results in filename like 710712-domain-DRUPAL-6--2.patch. This way it's easy to find all module or version specific patches.
Or at least that's how I've understood/used it;)
Comment #55
fizk commentedTo add to the Cancel button bug, there really is no Form API Cancel button, its' just a HTML link pointing back to VBO's first page.
Comment #56
fizk commentedOK, this works for me! :)
Please try to break it.
Comment #57
fizk commentedComment #58
agentrickardI'd still like to see the code duplication between
domain_content_node_operations_access_submit_processanddomain_content_update_nodesremoved.I also just noticed that this method will not work properly IFF another module uses hook_domainrecords(). We are deliberately writing to the {node_access} table, and in some cases, that will not be desired. We may need to invoke
node_access_needs_rebuild()if hook_domainrecords() is present.Comment #59
fizk commentedUnless you can do this very quickly, let's make this a separate issue after the patch is included in HEAD.
Why not just invoke hook_domainrecords every time? Please update the patch if we need to add this.
Comment #60
fizk commentedAlso, did you test the patch in #56?
Comment #61
agentrickard1. No. I'm not putting redundant code in HEAD. You want the feature? Write the code better.
2. We have to refactor domain_content_update_nodes() to incorporate hook_domainrecords(). That's part of the work to be done. That _could_ however, be split to a new issue.
3. No. It's not ready. So I didn't test it.
Comment #62
fizk commented1. No. I'm not putting redundant code in HEAD. You want the feature? Write the code better.
You wrote it, actually. I don't know how the domain system works, so I can't change this.
2. We have to refactor domain_content_update_nodes() to incorporate hook_domainrecords(). That's part of the work to be done. That _could_ however, be split to a new issue.
Thanks, link back to here for reference.
3. No. It's not ready. So I didn't test it.
Please test. If it's broken, that is something I can help with.
Comment #63
agentrickard6.x is bugfix only. This is not a bug. It's a feature. And, no, I didn't write
domain_content_node_operations_access_submit_process().I'm busy with the D7 port.
Comment #64
agentrickardSplit off #756162: Domain Content ignores hook_domainrecords().
Comment #65
agentrickardHere's a better patch.
I _still_ don't like the VBO workflow, but am willing to let that go.
@fizk I need you to _document_ the VBO functions in this code. It's a black box, and I don't like those. In particular, I don't know what
domain_content_node_operations_process_submitis doing with the 'step' value.When testing, be aware that there are 3 separate use cases for this functionality. Your last patch broke two of them because it was entirely focused on VBO.
Comment #66
agentrickardThis will also be easy to integrate with #756162: Domain Content ignores hook_domainrecords() when ready.
Comment #67
fizk commentedI'll add the documentation.
What use cases did it break/not break? I tested single step mode (no confirmation page), confirmation page mode, and Batch mode.
Comment #68
agentrickardadmin/build/content -- the normal batch editing screen. Triggered a form submit when no values were passed.
Same for admin/domain/content/0.
As I said, the cases you discuss are only VBO operations. hook_node_operations() is also fired by core and by Domain Content. Note the argument changes required in
function domain_content_node_operations_process()to make this work.This patch is _not_ VBO-specific. It adds VBO support and extends generic node_operations.
Comment #69
fizk commentedOh, I thought
hook_node_operations()was for VBO only.Comment #70
agentrickardNope. It's a core hook. One that we used to implement only on the Domain Content pages. Now we're opening it up to all three.
See http://api.drupal.org/api/function/hook_node_operations
This is why I keep saying that I don't like how VBO handles the form. It's different from the other two uses.
Comment #71
fizk commentedrickard, what do you think using Drupal actions instead of node_operations?
http://drupal.org/node/712912#comment-2783974
Comment #72
agentrickardThe D6 version of DA is bugfix only, so if we're taking any approach other than this, it needs to be addressed in a separate module.
I would be ok with removing the VBO portions of this patch, committing the other changes, and letting VBO support happen somewhere else.
There is an existing module for this functionality: http://drupal.org/project/domain_actions
The purpose of the core DA suite is to support Drupal core. VBO is a special case that I do not feel compelled to support.
Comment #73
fizk commentedEveryone that needs VBO support, head over to http://drupal.org/project/domain_actions.
Comment #74
agentrickardI was a little surprised to see this closed. Note the changes here, if looking at how actions might work.
#757746: please add different way for "Change affiliate publishing options"
Comment #75
agentrickardI committed this version of the patch to 6.x.2 and HEAD.
Comment #76
agentrickardAccidentally left in some VBO-specific cruft.
Comment #77
fizk commentedAweseome, can you describe how the patch in #75 fixes this bug?
Comment #78
agentrickardIt doesn't "fix" anything. There was never a bug. Domain Content just doesn't support VBO.
The code refactor makes it easier for other modules to abstract some of the functions for use. See
domain_content_add_form_widget()anddomain_content_update_nodes()specifically.Any actions should leverage these functions.
Comment #79
fizk commentedAh, ok.
Alrighty, when someone, maybe me, actually fixes this issue "How to change content affiliation for 1000+ nodes", we'll come back here and mark this issue as fixed.
Thanks for including the patch in #75 into HEAD.
Comment #80
drvdt commentedHow to do this with Drupal 7. VBO does not have.
Thanks
Comment #81
agentrickardDomain Content can still do this.
Comment #82
drvdt commented@ agentrickard
Yes, but that page can not fill by all field.
I have a solution for this issue:
- Step 1. Use VBO, can use any fill condition, change all nodes you want to "Stick"
- Step 2. Use admin/content use stick filter, change all node you have to domain you want
- Step 3. Use VBO, use stick filter, change back to Un-Stick
Comment #83
UksusoFF commentedComment #84
UksusoFF commentedLook at: https://www.drupal.org/project/domain_vbo
Comment #85
bluegeek9 commentedDrupal 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.