<![CDATA[ php fatal error in Gallery 1.5.2-pl - My Forums]]> https://forums.modx.com/thread/?thread=79706 <![CDATA[Re: php fatal error in Gallery 1.5.2-pl]]> https://forums.modx.com/thread/79706/php-fatal-error-in-gallery-1-5-2-pl#dis-post-441854 https://github.com/splittingred/Gallery/issues/240]]> fen1kz Oct 30, 2012, 05:13 PM https://forums.modx.com/thread/79706/php-fatal-error-in-gallery-1-5-2-pl#dis-post-441854 <![CDATA[Re: php fatal error in Gallery 1.5.2-pl]]> https://forums.modx.com/thread/79706/php-fatal-error-in-gallery-1-5-2-pl#dis-post-441657 http://tracker.modx.com/ for MODx issues

https://github.com/splittingred/Gallery/issues for Gallery issues]]>
sottwell Oct 29, 2012, 12:17 AM https://forums.modx.com/thread/79706/php-fatal-error-in-gallery-1-5-2-pl#dis-post-441657
<![CDATA[Re: php fatal error in Gallery 1.5.2-pl]]> https://forums.modx.com/thread/79706/php-fatal-error-in-gallery-1-5-2-pl#dis-post-441638 fen1kz Oct 28, 2012, 03:05 PM https://forums.modx.com/thread/79706/php-fatal-error-in-gallery-1-5-2-pl#dis-post-441638 <![CDATA[Re: php fatal error in Gallery 1.5.2-pl]]> https://forums.modx.com/thread/79706/php-fatal-error-in-gallery-1-5-2-pl#dis-post-440693
thanks a lot for this q&d fix, works like charm.

Have you filed a bug report as well?]]>
chris@crnm Oct 18, 2012, 01:06 PM https://forums.modx.com/thread/79706/php-fatal-error-in-gallery-1-5-2-pl#dis-post-440693
<![CDATA[php fatal error in Gallery 1.5.2-pl]]> https://forums.modx.com/thread/79706/php-fatal-error-in-gallery-1-5-2-pl#dis-post-438961 this is supposed to show all albums (and it shows laugh) but if you have request var (default is galAlbum) and set it to id which doesnt exist
like /gallery?galAlbum=99 (assuming u doesnt have album with ID 99 ) page wont load and shows you fatal error:

Warning: Invalid argument supplied for foreach() in lalala/modx/core/cache/includes/elements/modsnippet/18.include.cache.php on line #103#

Fatal error: Cannot use string offset as an array in lalala/modx/core/cache/includes/elements/modsnippet/18.include.cache.php on line #2#

these lines is:
#103#(line 103 in original snippet) foreach ($data['items'] as $item) {
#162#(line 162 in original snippet) $placeholderPrefix.'id' => $data['album']['id'],

i've quick fixed by adding

if (empty($data)) return '';
right after line 48: $data = $modx->call('galItem','getList',array(&$modx,$scriptProperties));

TLDR: if u call gallery with non-existing album - it breaks with fatal error on ur site
latest modx, latest gallery
there's a fix]]>
fen1kz Oct 03, 2012, 05:00 PM https://forums.modx.com/thread/79706/php-fatal-error-in-gallery-1-5-2-pl#dis-post-438961