Closed (fixed)
Project:
Node Gallery
Version:
6.x-3.0-alpha3
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
16 May 2011 at 17:55 UTC
Updated:
4 Aug 2011 at 19:21 UTC
Jump to comment: Most recent file
Comments
Comment #1
CoreyMoore commentedI am getting this error:
The corresponding line is a part of the patch:
I am not a PHP expert, but it appears that PHP 5 causes this bug (because of the way it handles array_merge. I am about to call it a day, but I am going to try and see if I can fiddle with it a bit.
Comment #2
CoreyMoore commentedOk, if I change the syntax of the code to this:
It stops throwing array_merge errors. It still does not apply the gallery group to the image. I'm going to try and attack this tomorrow (maybe looking through the Views Gallery OG integration module may help).
Comment #3
scroogie commentedI think you should reverse the patch and start over.
You have to look at node_gallery_nodeapi()
in case 'insert': for the image type you need to do something similar as in the patch, retrieve the organic group of the gallery and set it for the image. Something like
<?
$gallery_node = node_load($node->gid);
$node->og_groups = $gallery_node->og_groups;
$node->og_groups_both = $gallery_node->og_groups_both;
?>
before the drupal_write_record()
In case 'update': you need something similar as in the original patch as well, updating the group of all images in the gallery if the gallery is updated. This would better be done in batch API though.
Comment #4
CoreyMoore commentedOk, adding the code above to the in case 'insert' worked perfectly. However, I am a bit confused about in case 'update.' This is where a node would be updated, correct? I am reading the documentation about batch API right now. Hopefully I can roll out a patch in a couple of hours :)
Comment #5
CoreyMoore commentedOk, this is the code I am trying:
I'm not using batch API, although it may be better. The code should update all of the image nodes within the gallery when the gallery is updated, if I understand the 'update' case correctly. It isn't, however, so I am going to continue working on it. I am not sure whether or not I am calling the correct object with 'node_gallery_get_types('images')'.
Comment #6
scroogie commentedIn case 'update': you need to add after
something like (untested)
Comment #7
scroogie commentedPerhaps you can try this patch.
Comment #8
scroogie commentedCoreyMoore: Could you perhaps review the patch?
Comment #9
CoreyMoore commentedOh, I am very sorry for not checking on this earlier. I didn't apply the patch as written, but I did use the code you suggested, and it worked correctly.
Comment #10
scroogie commentedI see. Thank you anyway. Perhaps someone else has an install with OG enabled?
Comment #11
jaapjan commentedPatch in #7 works for me! Thanks!
You might also want to add a form_alter on the image node form to hide the group settings there. I did it in a custom form stuff module.
Comment #12
Crom commentedI'm looking to integrate NG 3.0-dev into an OG site and am happy to test the patch but after a lot of reading of the issue queue and elsewhere, I have a couple of questions:
I'm looking to allow users to upload personal galleries into their profiles using node_gallery_user_profile. I'd also like group members to be able to upload galleries to groups they are members of. The former would presumably just be posted as 'nodes' and the latter as would presumably be posted as group nodes. so...
1) Should I alter the NG content types to be 'group nodes' or 'standard group posts' or create a new set of NG content types and create a new relationship in the module settings page? Hmmm, I guess that will knacker my plupload integration as it can only be pointed at one field. So, I guess that I can have either group galleries or personal galleries and just use node_gallery_user_profile to display those galleries that users have uploaded to public groups?
2) Is the patch compatible with dev as it looks like it's been written for alpha3
Cheers,
Crom
Comment #13
Crom commentedFollowing some testing and in response to my own questions - in case anyone else wants to try this:
1) I altered the gallery content type to a standard group post and then controlled the access with the OG audience setting for each gallery that is created. This seems to work fine for both group galleries and personal galleries
2) The patch seems to work fine with the current dev version of NG3
Comment #14
foredoc commentedJaapie,
I also need to hide the group settings on the image node form, and tried to unset($form['og_nodeapi']) without success. Could you share with me the way to hide it in hook_form_alter?
Thanks.
Comment #15
foredoc commentedseems
$form['og_nodeapi']['#access'] = FALSEdo the job.Comment #16
foredoc commentedwill this patch be included in the next release of NG, say 6.x-3.0-beta3 ?
Thanks.
Comment #17
justintime commentedAttached patch takes #7 and #15 rolled into one. If you can test this patch and mark this as RTBC, I'll get it into beta3.
Comment #18
foredoc commentedAn error found:
line # 417, line#19(patch file): if (module_exists('og') {
should be : if (module_exists('og') ) {
Thanks.
Comment #19
foredoc commentedAnother :
line # 418(node_gallery.module), line#20(patch file): $form['og_nodeapi']['#access'] = FALSE
should be: $form['og_nodeapi']['#access'] = FALSE;
Comment #20
foredoc commentedI applied the patch for 6.x-3.0-beta2, after fixing the two lines mentioned above, it works.
Thanks.
Comment #21
justintime commentedSheesh, that's embarassing. Guess you can tell I did that in a hurry.
I've committed the patch plus your fixes into 6.x-3.x.
Comment #22
foredoc commented:) Thanks a lot!