I am using a new content type configured display multiple images using colorbox with the images stored in a custom public directory.

sites/image/gallery1

If I look at the image url for the colorbox main image I can see the image by itself as expected but if I remove the image from the end of the url I get a weird error displayed three times on my Drupal 404 page not found page:

Notice: Trying to get property of non-object in image_style_deliver() (line 756 of /web/directory/public_html/modules/image/image.module).

Is this a colorbox issue or an image.module issue?

Comments

nevets’s picture

It is not clear what you are doing, are you using code to display to color box?

velvetpixel’s picture

Here is my workflow and the result is a gallery that opens a colorbox when an image is clicked.

/admin/structure/types

Click Add Content Type, name it Gallery and the click Save and Add Fields.

Add New Field
Label = Gallery Image
Name = field_gallery_image
Field = Image
Widgit = Image

Click save

Select Pubic files for Upload Destination
Click Save Field Settings

On Gallery settings page:
Set custom directory for images called gallery (my drupal public directory for images is in sites/images so this makes a directory sites/images/gallery)

Set Number of Values to Unlimited.

On Manage Display:
For the Gallery field set label to hidden
Change format from image to Colorbox and click the icon to configure to set my node and colorbox images.

Click save.

/admin/content

Click Add Content and then select the Gallery content type.

Give it a title

Add images.

Click save

This works as expected and I get my gallery and my colorbox works.

An example url for an image is:
http://example.com/sites/images/styles/large/public/gallery/image.jpg

and for a thumbnail:
http://example.com/sites/images/styles/thumbnail/public/gallery/image.jpg

Those each will display on their own in a browser.

Now for the problem! :)

If I remove the image from the end of the url:
http://example.com/sites/images/styles/large/public/gallery/

and load the page I get the error I posted above.

Is this a colorbox issue or a image.module issue and a problem I need to address with drupal core?

nevets’s picture

Why are you removing the image from the end of the path?

velvetpixel’s picture

Because it is standard QA to test paths with directories or content removed to confirm presentation is as expected.

It should just jive me a plain 404 but it it is giving me the error I mentioned on the 404.

nevets’s picture

image module is part of core, you could file an issue if you think it's a bug.

velvetpixel’s picture

Thanks I will do so :)

mikeytown2’s picture