I've been running Gallery2 (currently 2.2) within Drupal hosted at (mt) for a couple of years now.
However, over the last few days, I've started to get a blank page and the following error in debug when trying to view the main page.
Fatal error: Call to undefined method GalleryAlbumItem::getWidth() in /home/xxxx/domains/xxxx.com/html/gallery2/modules/core/classes/GalleryTheme.class on line 1550
I can still click directly through to specific images from the gallery sidebox, but if I try to then move back up the tree, the same thing happens.
I've read through countless issues of blank pages, but none seem to be sharing the same debug message.
Any ideas where I should look?
Thanks
Posts: 32509
see:
FAQ: What information is required when I ask for help in the forums?
--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage
Posts: 10
Apologies.
Cannot access the SiteAdmin page - unless I access an image directly, every other page appears blank
The website can be viewed at http://www.thederricksonline.com/gallery2 (user: test, password: test)
You can view phpinfo at http://www.thederricksonline.com/gallery2/phpinfo.php
I've left it set in Buffered debug.
Posts: 32509
either you'll have to add debug statements into GalleryTheme.class yourself.
or you need to
1. enable "immediate" instead "bufferd" debug mode
2. clear the entity/database cache (lib/support/index.php -> cache
3. trigger the error again.
on the page that shows the error, we'll probably see which entityId caused the problem.
--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage
Posts: 10
I've changed the debug to immediate, but unable to load the "lib/support/index.php" page - coming back with a different error.
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/1899/domains/thederricksonline.com/html/gallery2/modules/core/classes/Gallery.class:758) in /home/1899/domains/thederricksonline.com/html/gallery2/lib/support/GallerySetupUtilities.class on line 75
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/1899/domains/thederricksonline.com/html/gallery2/modules/core/classes/Gallery.class:758) in /home/1899/domains/thederricksonline.com/html/gallery2/lib/support/GallerySetupUtilities.class on line 75
Warning: Cannot modify header information - headers already sent by (output started at /home/1899/domains/thederricksonline.com/html/gallery2/modules/core/classes/Gallery.class:758) in /home/1899/domains/thederricksonline.com/html/gallery2/lib/support/GallerySetupUtilities.class on line 210
Posts: 32509
you need to disable immediate debug mode while using lib/support/. immediate debug mode interfers heavily with everything.
--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage
Posts: 10
OK, I've now cleared the cache - and put it back into Immediate Debug mode.
Thanks.
Posts: 32509
now you need to trigger the error again....and look for the ids in the sql queries.
--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage
Posts: 10
So what else am I looking for?
I've done all suggested, and reloaded the page, and apart from multiple lines of debug data, I'm still getting the same final error.
Fatal error: Call to undefined method GalleryAlbumItem::getWidth() in /home/1899/domains/thederricksonline.com/html/gallery2/modules/core/classes/GalleryTheme.class on line 1550
Using the test/test account, you should be able to see the same.
Thanks.
Posts: 32509
use immediate debug mode, then you should see other output before the fatal error. in that debug output, you should see some SQL queries / cache lookups and from that you can find out which entity-id in the db causes the problem.
--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage
Posts: 10
The only line mentioning entityID is the following:
(mysqli): SELECT g_entityId FROM g2_ExternalIdMap WHERE g_externalId='2' AND g_entityType='GalleryUser'
Apart from this, there are multiple lines which unfortunately mean nothing to me.
I've put a copy of the whole debug output at the following location: http://www.thederricksonline.com/debug.html
Could anyone guide me to where the problem may be?
Thanks.
Posts: 32509
the last query before the error is:
> SELECT g2_Derivative.g_id, g2_ChildEntity.g_parentId FROM g2_Derivative, g2_ChildEntity WHERE g2_Derivative.g_id = g2_ChildEntity.g_id AND g2_ChildEntity.g_parentId IN
> (19,2834,2963,3091,3172,5503,6525) AND g2_Derivative.g_derivativeType IN (1)
please run this query in your database (e.g. with phpmyadmin).
what are the results of the query?
--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage
Posts: 10
This is what I get:
SQL result
Host: internal-db.s1899.gridserver.com
Database: db1899_gallery2
Generation Time: Feb 11, 2008 at 04:43 AM
Generated by: phpMyAdmin 2.11.0 / MySQL 4.1.11-Debian_4sarge7
SQL query: SELECT g2_Derivative.g_id , g2_ChildEntity.g_parentId FROM g2_Derivative , g2_ChildEntity WHERE g2_Derivative.g_id = g2_ChildEntity.g_id AND g2_ChildEntity.g_parentId IN ( 19 , 2834 , 2963 , 3091 , 3172 , 5503 , 6525 ) AND g2_Derivative.g_derivativeType IN ( 1 ) LIMIT 0, 30 ;
Rows: 8
g_id 13 21 2855 2973 3098 3179 5510 6532
g_parentId 19 2834 2834 2963 3091 3172 5503 6525
Posts: 32509
please run this query:
select g_id, g_entityType from g2_Entity where g_id in (13,21,2855,2973,3098,3179,5510, 6532,19, 2834, 2834, 2963, 3091, 3172, 5503, 6525);
--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage
Posts: 10
SQL result
Host: internal-db.s1899.gridserver.com
Database: db1899_gallery2
Generation Time: Feb 11, 2008 at 05:56 AM
Generated by: phpMyAdmin 2.11.0 / MySQL 4.1.11-Debian_4sarge7
SQL query: select g_id , g_entityType from g2_Entity where g_id in ( 13 , 21 , 2855 , 2973 , 3098 , 3179 , 5510 , 6532 , 19 , 2834 , 2834 , 2963 , 3091 , 3172 , 5503 , 6525 ) LIMIT 0, 30 ;
Rows: 15
g_id g_entityType
13 GalleryDerivativeImage
19 GalleryAlbumItem
21 GalleryAlbumItem
2834 GalleryAlbumItem
2855 GalleryDerivativeImage
2963 GalleryAlbumItem
2973 GalleryDerivativeImage
3091 GalleryAlbumItem
3098 GalleryDerivativeImage
3172 GalleryAlbumItem
3179 GalleryDerivativeImage
5503 GalleryAlbumItem
5510 GalleryDerivativeImage
6525 GalleryAlbumItem
6532 GalleryDerivativeImage
Posts: 32509
21 GalleryAlbumItem
that's the problem child
please run the following query and report the results:
select * from g2_Entity e left join g2_ChildEntity c on c.g_id = e.g_id left join g2_FileSystemEntity f on f.g_id = e.g_id left join g2_Item i on i.g_id = e.g_id left join g2_AlbumItem a on a.g_id = e.g_id left join g2_Derivative d on d.g_id = e.g_id left join g2_DerivativeImage di on di.g_id = e.g_id where e.g_id = 21--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage
Posts: 10
SQL result
Host: internal-db.s1899.gridserver.com
Database: db1899_gallery2
Generation Time: Feb 11, 2008 at 08:24 AM
Generated by: phpMyAdmin 2.11.0 / MySQL 4.1.11-Debian_4sarge7
SQL query: select * from g2_Entity e left join g2_ChildEntity c on c.g_id = e.g_id left join g2_FileSystemEntity f on f.g_id = e.g_id left join g2_Item i on i.g_id = e.g_id left join g2_AlbumItem a on a.g_id = e.g_id left join g2_Derivative d on d.g_id = e.g_id left join g2_DerivativeImage di on di.g_id = e.g_id where e.g_id = 21 LIMIT 0, 30 ;
Rows: 1
g_id 21
g_creationTimestamp 1161693744
g_isLinkable 0
g_linkId NULL
g_modificationTimestamp 1167582611
g_serialNumber 122
g_entityType GalleryAlbumItem
g_onLoadHandlers NULL
g_id 21
g_parentId 2834
g_id 21
g_pathComponent Construction
g_id 21
g_canContainChildren 1
g_description
g_keywords
g_ownerId 6
g_summary
g_title Construction
g_viewedSinceTimestamp 1161693744
g_originationTimestamp 1161693744
g_renderer NULL
g_id 21
g_theme
g_orderBy originationTimestamp
g_orderDirection asc
g_id 21
g_derivativeSourceId 20
g_derivativeOperations thumbnail|150
g_derivativeOrder 0
g_derivativeSize NULL
g_derivativeType 1
g_mimeType image/jpeg
g_postFilterOperations NULL
g_isBroken 0
g_id 21
g_width 150
g_height 150
Posts: 32509
heh, that's weird. no idea how that ended up in the database.
so you have an Albumitem there which is a derivative at the same time.
you should be able to fix this by:
1. run these queries:
Delete from g2_Derivative where g_id = 21;
Delete from g2_DerivativeImage where g_id = 21;
2. clear the db / entity cache (FAQ: How can I clear cached data?)
--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage
Posts: 10
Bingo! That did it?
Any idea how it happened? Should it be something I should keep an eye out for happening again?
Thanks for your help!
Mark.
Posts: 32509
No idea. If you find out how to reproduce this problem (what steps are needed to create this state), please let us know.
Cheers.
--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage
Posts: 4
I am also experiencing the same issue with one of my larger gallery sites:
If debug (logged) is set:
Fatal error: Call to undefined method GalleryAlbumItem::getWidth() in /var/www/web14/web/gallery2/modules/core/classes/GalleryTheme.class on line 1550is received on the main page
If debug (immediate) is set:
(mysqli): SELECT g2_Derivative.g_id, g2_ChildEntity.g_parentId FROM g2_Derivative, g2_ChildEntity WHERE g2_Derivative.g_id = g2_ChildEntity.g_id AND g2_ChildEntity.g_parentId IN (24047,92444) AND g2_Derivative.g_derivativeType IN (1)If I run this statement in phpMyAdmin:
is returned
This issue is repeatable if I restore an old copy of the database and reattempt my upload que. I am uploading using Gallery Remote (used for uploading well over 100,000 pics to this site) and I am resizing to a very small (less than 640x480) size prior to uploading. I have restored the database twice, the second time I skipped the 7th sub-album of the series thinking it could be related to a file, but the issue occured on the 8th sub-album instead
I have cleared the cache (to no avail)
I have determined that I can access albums directly, by link, but I can't view the main page at all. If I go beyond the main page and navigate to a sub-album, I can use the navigation links to traverse back to the most recent album. The final image in this album says "no thumbnail available". I have deleted this image, and the 50 images before it, no dice there either.
If I navigate back to the parent album, I can't delete any sub-albums from the dropdown (page halfway loads)
Immediate debug output tells me:
Manual execution of the SQL statement gives me:
If I run the same statement and use 92444 as the g_itemId, the same thing is returned ( 7/ )
If I select edit album from the dropdown, I can in fact use the delete link on the left menu.
Deleting the album that was created and uploaded to when the error occurred also did not resolve the issue
Any ideas/suggestions?
Thanks in advance for your assistance.
Posts: 4
Here is the first few lines of the g2_ItemAttributesMap table sorted by g_parentSequence:
Don't know if that will help at all or not.