I'm really confused... When I install and enable Node Gallery, both the Gallery and Gallery Image content types are created, but only Gallery is available on the "Create Content" page. However, if I go to the Modules page, and disable "Node Gallery", then both Gallery and Gallery Image appear on the "Create Content" page. Anyone have an idea why this is happening? If I leave the module disabled, and go to create a Gallery Image, I get the wrong fields--there's no image field for me to upload an image. I've increased my memory_limit, (sometimes that solves these kinds of bugs), but it didn't work.

Comments

lierbag’s picture

Just noticed something else. If I try and make a gallery and then Manage the images, I get this error message:

warning: Invalid argument supplied for foreach() in /home/content/r/s/c/rscanlon/html/sites/all/modules/node_gallery/node_gallery.pages.inc on line 290.

On line 290 of node_gallery.pages.inc there's a reference to $gallery->images, and I'm guessing that's part of the problem?

foreach ($gallery->images as $fid => $f) {
$options[$fid] = '';
if ($f->is_cover) {
$cover_fid = $fid;
}
}

Hope this helps. I'm not skilled enough to debug this. :)

lierbag’s picture

Another update...When Node Gallery is enabled, I can create a Gallery, and Upload images to it. And the images display fine. So the only problem is that I can' t go directly to Create Content -> Gallery Image. It's just not there.

dbeall’s picture

hi Gabe,
The issue after disable the module may be a cache thing..
The enabled with out create image node available is normal.

....This text is from the handbook.
# The Gallery content type is listed on the create content page and is visible to the end user. The gallery node handles all creation, display and editing functions for the gallery (it is the control and display panel for each gallery). The gallery node calls upon the image nodes when they are needed for display or editing.
# The Image content type is (not) listed on the create content page and is (hidden) from the end user. The image nodes are used internally by the gallery node. The image nodes are called upon by the gallery node when needed.

please reply back if there are problems.. someone is always around to help

dbeall’s picture

sorry.. comment #1..the error might be a different issue..?

warning: Invalid argument supplied for foreach() in /home/content/r/s/c/rscanlon/html/sites/all/modules/node_gallery/node_gallery.pages.inc on line 290.

dbeall’s picture

this line might be wrong

$options[$fid] = ";

.....maybe should be....

$options[$fid] = ' ';

EDIT: I am no code person either, I just looked at my copy of alpha 11 and the code on that line looks like the ( " ) is actually (two ' ' ).. might be a comment typo..

dbeall’s picture

Component: User interface » Code
Status: Needs review » Active

I traced your steps and had the same issues too.

** The first one is a kind of a duplicate or related issue #523294: Uninstall does not remove records created by this module
* The disable function is not deleting the content types and the create image node shows up..
* then after re-enabling the module, it would not display images, but they would upload and are in the file system.
* The images did not show on the manage images page either
* It did not give me an error, but it is broken...
* The permissions were partially disabled after the module was disabled, but, fixing permissions did not fix the gallery.

This post was edited... to include more details
This maybe should be marked as critical..???

balik kampung’s picture

Hi folks.
For the error in #1, try to add (array) in the code.
Ex:
foreach ((array) $gallery->images as $fid => $f) {
$options[$fid] = '';
if ($f->is_cover) {
$cover_fid = $fid;
}
}

It worked for me.
goodluck

kmonty’s picture

Status: Active » Closed (won't fix)

The Gallery Image node type is purposely removed from create content because adding an image node from node/add/gallery-image does not work correctly. You must create a Gallery Image node by uploading an image.