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.
When I set "publish to" option (Domain Access - http://drupal.org/project/domain) of a Node Gallery, this field is not replicated individually in each image of the gallery.
Thus, when I visit that domain, only the text appears in the gallery, but not their images.
Within Mysql it must create a record for each image within "domain_access" table (field "realm" = "domain_id")
Comment | File | Size | Author |
---|---|---|---|
#13 | node_gallery_domain.tar_.gz | 1012 bytes | nienaber |
#10 | node_gallery_domain.tar_.gz | 1.51 KB | nienaber |
Comments
Comment #1
nienaber CreditAttribution: nienaber commentedDo you have a fix for this or asking if someone has a fix?
Comment #2
rogeriodec CreditAttribution: rogeriodec commentedNo. I think anyone knew around this (at least the developers of this module) but by the way this bug will be left open.
Comment #3
nienaber CreditAttribution: nienaber commentedAre you using the pluploaded module to do the uploads for the images?
Comment #4
rogeriodec CreditAttribution: rogeriodec commentedYes, why?
Comment #5
nienaber CreditAttribution: nienaber commentedWith my setup the domain I am using to upload the images with is being set as the default domain. I am busy writing a module that will fix the uploads and make sure that the images have the same subdomains as the parent node. When I get it working I will share it with you. Probably next hour or two.
Comment #6
rogeriodec CreditAttribution: rogeriodec commentedGreat!
Just to clarify, my problem is as follows:
1) I create a node gallery (title, text, etc.) assigned to domain X
2) I upload the images (pupload) and they are correctly assigned to domain X
3) At another moment, I want to add another domain (Y) to allow viewing this gallery.
4) When I edit this node, it has domains X and Y assigned, but the images remains only with domain X
Comment #7
nienaber CreditAttribution: nienaber commentedYup, this is similar to my problem.
Comment #8
nienaber CreditAttribution: nienaber commentedSo this is what I have so far. There seems to be some incompatibility with domain and plupload. For your scenario as outlines above the following code will fix the problem:
What doesn't work is if you have changed the "publish to" to say x, y ,z and then use the pluload to add another image. It will only take the default domains. The work around for this is to simply "edit" the gallery, hit save and it will update all images to the correct domain assignment. When I figure out the problem with plupload I will post an update. I have to dig into some more of the code.
Let me know if this sorts your problem.
Comment #9
rogeriodec CreditAttribution: rogeriodec commentedThank you!
Excuse my ignorance, but where will I implement this code?
Comment #10
nienaber CreditAttribution: nienaber commentedI have folded it into an independent module. This is not an official module and you use it as your own risk (just a generic disclaimer).
Drupal.org has renamed the file to node_gallery_domain.tar_.gz, just remove the "_" and unzip it in your modules folder. Enable the module and it will work right out of the box.
Let me know if it sorts your problem.
Comment #11
rogeriodec CreditAttribution: rogeriodec commentedI think it's not working.
I installed and activated the module, I edited a node gallery by adding a new domain in the list "to publish", but nothing changes in the nodes of the images, still with the same old domain, no new additions ...
Comment #12
nienaber CreditAttribution: nienaber commentedFor what I tested the table domain_access was updated with the correct records. Not sure what the difference is with your configuration. There are still some scenarios where this module does not work and I am working on fixing that. I will update here when I have something more concrete. Sorry that quick fix didn't work for you. I will keep you posted on progress.
Comment #13
nienaber CreditAttribution: nienaber commentedI found that the plupload module was not calling the hook_node_access_records hook when it saved the image.
I hooked into hook_plupload_node_postsave and manually invoke the hook. When image nodes are being saved I retrieve its parent node domain settings and manually assign them to the node, just copying them essentially.
With my installation I have the node_gallery_taxonomy module enabled which I automatically updates all children nodes. I think that is the difference between your installation and mine. I have updated the module to batch update all its children nodes. I have updated the module here for you.
Let me know if that works for you.
Comment #14
rogeriodec CreditAttribution: rogeriodec commentedThank you again for your efforts.
But I think I'm not expressing myself correctly.
The problem does NOT occur in creating the node, but in its UPDATE. So I do not see what puload has to do with it.
So if I have a gallery with 5 images then I have a total of six nodes with attribution of the original domain (1 primary node + 5 nodes of images).
Later I decide that this gallery should be exposed in another domain, addition to the current domain.
When UPDATING the gallery node, If I check an additional domain in "publish to" in the gallery node, after saving this node, it does NOT check the same domain in the other five nodes of images.
Comment #15
nienaber CreditAttribution: nienaber commentedDid you download the new version of the module I included in my most recent post? That code fixes this very issue.
Let me know.
Thanks
Wickus
Comment #16
zengenuity CreditAttribution: zengenuity commented