Error when removing 'Everybody' permissions

volfman

Joined: 2005-03-31
Posts: 5
Posted: Thu, 2005-03-31 22:00

I think I may have found a bug:
I wanted to setup the gallery so that only logged in users can see the gallery. When changing the permissions of the main gallery page so that the group "Everyone" has no permissions, but "All Users" have View All Images permissions, there is an error when visiting the main gallery page. This error only occurs in Internet Explorer (tested 6.x on WinXP) and Safari (on Mac OS X). With Mozilla or Firefox, the login window comes up, and a normal user can login and view the gallery.
Error message:

Database Error
An error has occurred while interacting with the database.

Back to the Gallery

Error Detail -
Error (ERROR_STORAGE_FAILURE) :
in modules/core/classes/GalleryStorage/DatabaseStorage.class at line 1150 (gallerystatus::error)
in modules/core/classes/GalleryStorage.class at line 220 (mysqldatabasestorage::search)
in modules/core/classes/Gallery.class at line 206 (gallerystorage::search)
in modules/core/classes/helpers/GalleryItemHelper_advanced.class at line 667 (gallery::search)
in modules/core/classes/GalleryCoreApi.class at line 1500 (galleryitemhelper_advanced::fetchalbumtree)
in modules/albumselect/module.inc at line 128 (gallerycoreapi::fetchalbumtree)
in modules/core/classes/GalleryLayout.class at line 711 (albumselectmodule::loadsystemcontent)
in layouts/matrix/layout.inc at line 262 (classiclayout::loadlayouttemplate)
in layouts/classic/layout.inc at line 155 (matrixlayout::_loadalbumtemplate)
in layouts/matrix/layout.inc at line 155 (classiclayout::_loadalbumtemplate)
in modules/core/ShowItem.inc at line 152 (classiclayout::loadtemplate)
in modules/core/classes/GalleryView.class at line 239 (showitemview::loadtemplate)
in main.php at line 293 (showitemview::doloadtemplate)
in main.php at line 79
in main.php at line 70

Anyone seen this error?

----

Gallery URL (optional):
Gallery version: G2 (cvs from 3/30/2005)
Webserver (with version): Apache 1.3.33
Datatabase (with version): Mysql 4.0.x
PHP version (eg 4.2.1): 4.3.10
phpinfo URL (optional): http://www.thevolf.com/phpinfo.php
Graphics Toolkit(s): ImageMagick
Operating system: Linux 2.6.x
Web browser/version: Internet Explorer / Firefox
G1 version (for migration bugs):

 
volfman

Joined: 2005-03-31
Posts: 5
Posted: Fri, 2005-04-01 06:47

Anyone verify this problem on their Gallery?

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Fri, 2005-04-01 09:03

Edit your config.php and turn on buffered debug mode like this:

$gallery->setDebug('buffered');

Then try again. This time, you'll get quite a lot of debug output
when you get the error. Look towards the bottom of the debug output
and scan backwards for anything that looks like an error, then report
that here. Usually that will give us enough information to work with.
If you can't understand what you're seeing, err on the side of posting
more info. If it's going to be more than 30-40 lines of output, you
should save it into a text file and publish it on your own website and
post a link to it here (so that the forum remains readable).

 
volfman

Joined: 2005-03-31
Posts: 5
Posted: Sat, 2005-04-02 02:19

Full Debug output:
http://www.thevolf.com/gallery-error.txt

Relevant error:
mysql error: [1064: You have an error in your SQL syntax. Check the
manual
that corresponds to your MySQL server version for the right syntax to use
near '?)
ORDER BY
g2_ItemAttributesMap.g_parentSequence,
g2_It] in EXECUTE("
SELECT
g2_AlbumItem.g_id,
g2_ItemAttributesMap.g_parentSequence,
g2_ItemAttributesMap.g_orderWeight
FROM
g2_AlbumItem, g2_ItemAttributesMap, g2_AccessSubscriberMap
WHERE
g2_AlbumItem.g_id = g2_ItemAttributesMap.g_itemId
AND
g2_ItemAttributesMap.g_parentSequence LIKE '7/%'
AND
g2_AlbumItem.g_id = g2_AccessSubscriberMap.g_itemId
AND
g2_AccessSubscriberMap.g_accessListId IN (?)
ORDER BY
g2_ItemAttributesMap.g_parentSequence,
g2_ItemAttributesMap.g_orderWeight
")

--------------------------------------------------------------------------------
(mysql):
SELECT
g2_AlbumItem.g_id,
g2_ItemAttributesMap.g_parentSequence,
g2_ItemAttributesMap.g_orderWeight
FROM
g2_AlbumItem, g2_ItemAttributesMap, g2_AccessSubscriberMap
WHERE
g2_AlbumItem.g_id = g2_ItemAttributesMap.g_itemId
AND
g2_ItemAttributesMap.g_parentSequence LIKE '7/%'
AND
g2_AlbumItem.g_id = g2_AccessSubscriberMap.g_itemId
AND
g2_AccessSubscriberMap.g_accessListId IN (?)
ORDER BY
g2_ItemAttributesMap.g_parentSequence,
g2_ItemAttributesMap.g_orderWeight

--------------------------------------------------------------------------------
1064: You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use near
'?)
ORDER BY
g2_ItemAttributesMap.g_parentSequence,
g2_It

adodb_mysql._execute(
SELECT
g2_AlbumItem.g_id,
g2_ItemAttributesMap.g_..., false) %
line 833, file: adodb.inc.php

adodb_mysql.execute(
SELECT
g2_AlbumItem.g_id,
g2_ItemAttributesMap.g_..., Array[0]) % line 1142, file:
DatabaseStorage.class

mysqldatabasestorage.search(
SELECT
[GalleryAlbumItem::id],
[GalleryItemAttrib..., Array[0], Array[0]) % line 220, file:
GalleryStorage.class

gallerystorage.search(
SELECT
[GalleryAlbumItem::id],
[GalleryItemAttrib..., Array[0], Array[0]) % line 206, file:
Gallery.class

gallery.search(
SELECT
[GalleryAlbumItem::id],
[GalleryItemAttrib..., Array[0]) %
line 667, file: GalleryItemHelper_advanced.class

--------------------------------------------------------------------------------
(mysql):
SELECT
g2_UserGroupMap.g_userId
FROM
g2_UserGroupMap
WHERE
g2_UserGroupMap.g_userId = 5
AND
g2_UserGroupMap.g_groupId = '3'
LIMIT 1
--------------------------------------------------------------------------------

realpath(/path_to_gallery/gallery2/modules/core/classes/../../../)

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2005-04-05 01:36

Fixed in the latest CVS. Thanks!

 
volfman

Joined: 2005-03-31
Posts: 5
Posted: Tue, 2005-04-05 02:12

I suppose it takes a few hours to get to the public CVS, because I just tried it and the issue still exists. I'll wait a few hours and try again.