[2016-11-01 13:45:14] (ERROR @ /home/xxxxxx/public_html/core/model/modx/modx.class.php : 991) `0` is not a valid integer and may not be passed to makeUrl() [2016-11-01 13:45:14] (ERROR @ /home/xxxxxx/public_html/core/model/modx/modx.class.php : 1827) PHP warning: Missing argument 2 for modX::parseChunk(), called in /home/xxxxxx/public_html/core/cache/includes/elements/modsnippet/3.include.cache.php on line 134 and defined [2016-11-01 13:45:14] (ERROR @ /home/xxxxxx/public_html/core/model/modx/modx.class.php : 1827) PHP warning: Missing argument 2 for modX::parseChunk(), called in /home/xxxxxx/public_html/core/cache/includes/elements/modsnippet/3.include.cache.php on line 134 and defined
[[!getImages? &getImages_Folder=`assets/images/hamline` &getImages_Tpl =`getImages_Image_Tpl` ]]
<div class="photos"> <img src="[[+imgLink]]" alt="[[+imgName]]" /> </div>
I'm getting a series of errors every time the page loads with a set of images from a folder. There is one for each image. This rapidly filling up my error log.
[2016-11-01 13:45:14] (ERROR @ /home/xxxxxx/public_html/core/model/modx/modx.class.php : 991) `0` is not a valid integer and may not be passed to makeUrl() [2016-11-01 13:45:14] (ERROR @ /home/xxxxxx/public_html/core/model/modx/modx.class.php : 1827) PHP warning: Missing argument 2 for modX::parseChunk(), called in /home/xxxxxx/public_html/core/cache/includes/elements/modsnippet/3.include.cache.php on line 134 and defined [2016-11-01 13:45:14] (ERROR @ /home/xxxxxx/public_html/core/model/modx/modx.class.php : 1827) PHP warning: Missing argument 2 for modX::parseChunk(), called in /home/xxxxxx/public_html/core/cache/includes/elements/modsnippet/3.include.cache.php on line 134 and defined
This is the call on the page.
[[!getImages? &getImages_Folder=`assets/images/hamline` &getImages_Tpl =`getImages_Image_Tpl` ]]
The Tpl is
<div class="photos"> <img src="[[+imgLink]]" alt="[[+imgName]]"> </div>
I've commented out the line in snippet for getfolder.
Modx 2.5.1 (new install)
GetImages 2.4.1
Any ideas?
/***** SET VARIABLES *****/ // $folder = isset($_GET['folder']) ? $_GET['folder'] : ''; // use to get folder from URL $folder = $modx->getOption('getImages_Folder', $scriptProperties, 'assets/photos'); // use to get default folder, or from parameters
As it happens, I have another site using getImages that is not generating any errors in the log. It is an older version, 2.3.2, and running a slightly different call.
So I copied the snippet code from that site and created a new snippet. It still generated errors.
I did notice the site with no errors is running php 7.0.12, where as the site generating errors is on 5.5.38. Both sites are running Modx 2.5.1
[2016-11-07 23:26:31] (ERROR @ /home/xxxxxx/public_html/core/model/modx/modx.class.php : 991) `0` is not a valid integer and may not be passed to makeUrl() [2016-11-07 23:26:31] (ERROR @ /home/xxxxxx/public_html/core/cache/includes/elements/modsnippet/3.include.cache.php : 96) PHP warning: array_map() expects parameter 1 to be a valid callback, function 'filename' not found or invalid function name [2016-11-07 23:26:31] (ERROR @ /home/xxxxxx/public_html/core/cache/includes/elements/modsnippet/3.include.cache.php : 96) PHP warning: array_multisort(): Argument #1 is expected to be an array or a sort flag
[[!getImages? &getImages_Folder=`assets/images/hamline` &getImages_Tpl =`getImages_Image_Tpl` &getImages_Sort=`filename` ]]