I would like to offer the opportunity for my user to choose their own gallery created earlier and therefore limit the publication of photography anyhow. I saw the "Upload to All Galleries" box in the rights of nodes, but it is unchecked, yet users can choose galleries that are not theirs. It's not logical.

I guess it's a bug, right?

Comments

zengenuity’s picture

Status: Active » Closed (works as designed)

The "Upload to All Galleries" permission controls access to the Upload tab on gallery nodes.

The gallery field on item nodes is an entityreference field, and doesn't limit the available galleries to post to. If you need to add this capability, you can do one of the following:

  1. Use field permissions to hide that field entirely. Users will still be able to add/remove items from the galleries from the Upload tab.
  2. Edit the node_gallery_ref entityreference field to limit based on a view you provide.

If you do the second one, it be great if you could provide a patch.

liquidcms’s picture

Version: 7.x-1.0 » 7.x-1.1
Status: Closed (works as designed) » Active

i think this is related...

i want to use a view to limit the galleries which can be picked to only the user's galleries (opposite what original poster was looking for). actually i want the item to remain in the original gallery and then allow the user to also add it to a public gallery.

i created a view to limit to the entityref field to only public galleries and it seems to limit and let me save. but the item is still only in the original gallery and is not in the public gallery. i changed the number of values for the entityref field to unlimited instead of 1 and i can now see (when i edit the item) both my original gallery and the public gallery selected (i removed the limit by view option). but when i save the item; i get WSOD.. and i mean really WSOD.. no php errors on startup or even logged.

and entityref field on its own wont cause this error so guessing some bug in Node Gallery that is doing it

liquidcms’s picture

perhaps in #1 where suggested using views to control list and providing a patch means that even though the interface on that field seems to allow this as a std entityref field would; it won't actually work without code change in NG?

liquidcms’s picture

the WSOD comes from this error:

Fatal error: [] operator not supported for strings in E:\www\eos\sites\all\modules\node_gallery\node_gallery_api.module on line 916

that lines is this:

$ngids[] = $ngids = $relationship->ngid;

not exactly sure what that is trying to do; but if simply changed to this:

$ngids[] = $relationship->ngid;

then i do not get a WSOD and my image now appears in both galleries

KiLLAH89’s picture

Hey liquidcms,

how do you get it to work with views? Can you post your code or an short tut?

Thanks.

KiLLAH89’s picture

Got it. If you want to display only the gallery in item creation that is created by its author, follow the steps.

Solution: 1. Add to your existing "Node Gallery: Gallery Item Views" a "entity reference".

2. Add a field "Content:Title".

3. Under format settings choose "Content:Title".

4. Setup a filter for "Node Gallery:Is Gallery" and choose "yes".

5. Add a relationship "Content:Author".

6. Add contextual filter "User:Uid" and choose relationship "Content:Author", i thinks its automatically choosen.

Now save the view.

7. Go to "admin/structure/types/manage/node-gallery-item/fields" and edit the entity field.

8. Choose under entity selection "Views: Filter by an entity reference view" and select your created entity view.

Save and enjoy.

Hope i help somebody.

bvirtual’s picture

I'm getting the line 916 error, and solved it the same way. I'm just plus one on this line 916 error.