Browse for http://example.com/gallery/any_nonexisting_string

I get:

Unable to initialize embedded Gallery. You need to configure your embedded Gallery.

The words "configure your embedded Gallery" contain a link pointing to

http://localhost/gallery/%3Cem%3E/admin/settings/gallery%3C/em%3E

Or, which is the same:

http://localhost/gallery/<em>/admin/settings/gallery</em>

...which clearly is a messed up code issue (probably due to missing out code needed which to be ported to drupal 5).

Phil

Comments

kiz_0987’s picture

Are you using the latest 5.x-1.x-dev code (from Dec 31st)? I thought I'd fixed all these in that version and I just rechecked and could not find the error.

filiptc’s picture

Title: Requesting wrong paths results in module errors » Requesting wrong paths results in confusing message

Updating gallery only fixes the <em>...</em> in the links but not the fact that browsing a nonexistent location gives the viewer (even anonymous) a pretty confusing error message with a link to the admin section. This is a major problem with viewers redirected from browsers with outdated indexes (i.e. pointing towards removed gallery items).

Instead, the default 404 message should be displayed.

kiz_0987’s picture

Priority: Critical » Normal

Do you mean that you have URL Rewrite on and trying to access an unknown photo in your gallery install and it returns an error? If so, then this is a known issue (http://drupal.galleryembedded.com/index.php/Troubleshooting#I_get_.22PHP...) which currently I do not know how to fix, due to what Gallery2 is returning. I'm open to suggestion :-)

filiptc’s picture

It does not just report 'an error', it reports the wrong error. I do not see

"PHP Fatal error: Call to a member function on a non-object"

but

Unable to initialize embedded Gallery. You need to configure your embedded Gallery.

and in the drupal logs i get:

Type: gallery
Date [...]
User [...]
Location http://localhost/gallery/something_that_does_not_exist
Referrer
Message Unable to initialize embedded Gallery. You need to configure your embedded Gallery.
Error (ERROR_STORAGE_FAILURE)

* in modules\core\classes\GalleryStorage\GalleryStorageExtras.class at line 993 (GalleryCoreApi::error)
* in modules\core\classes\GalleryStorage.class at line 505 (GalleryStorageExtras::addMapEntry)
* in modules\core\classes\GalleryCoreApi.class at line 2831 (GalleryStorage::addMapEntry)
* in modules\core\classes\GalleryEmbed.class at line 845 (GalleryCoreApi::addMapEntry)
* in C:\[...]\modules\gallery\gallery_base.inc at line 89 (GalleryEmbed::addExternalIdMapEntry)
* in C:\[...]\modules\gallery\gallery_block.inc at line 42
* inC:\[...]\modules\gallery\gallery.module at line 195
* in ??? at line 0
* in C:\[...]\includes\module.inc at line 386
* in C:\[...]\modules\block\block.module at line 689
* in C:\[...]\includes\theme.inc at line 1009
* in ??? at line 0
* in C:\[...]\includes\theme.inc at line 166
* in C:\[...]\themes\engines\phptemplate\phptemplate.engine at line 171
* in ??? at line 0
* in C:\[...]\includes\theme.inc at line 166
* in C:\[...]\index.php at line 33

Severity error
Name of machine 127.0.0.1

I do have URL-rewrite on but I don't see the message you say

jim_fulford’s picture

Did you resolve this, my installation started doing the same thing today.

filiptc’s picture

No I did not... It's not critical but I think it should get fixed. As I said, browsing a nonexistent gallery URL as anonymous (url-redirect on) and getting wrong and confusing error messages with links to the admin section is not a great thing. 404 would be the usual in those cases.

kiz_0987’s picture

Status: Active » Fixed

Fixed in 5--2 branch of the module.

Anonymous’s picture

Status: Fixed » Closed (fixed)