We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34147
    • 28 Posts
    Hey there, love the simplicity of the snippet, but having some issues with cache (at least that's what it says).

    Error being outgoing on webpage:
    "Warning: Missing argument 2 for modX::parseChunk(), called in /core/cache/includes/elements/modsnippet/32.include.cache.php on line 116 and defined in core/model/modx/modx.class.php on line 1761
    - See more at: http://….html#sthash.FhvRYLCL.dpuf"

    Snippet call:
    [[!getImages? 
    &getImages_Folder=`assets/images/[[*gallery_folder]]` 
    &getImages_Ext=`jpg,JPG,PNG,png`
    &getImages_Tpl=`success_story_gallery_Tpl`
    &getImages_Limit=`6`
    &getImages_Offset=`0`
    ]]


    It outputs the warning for each image being processed, as well as outputting the proper image. I have cleared the cache several times, including manually deleting the folders. Not sure what to do.
    • Line 116 of the getImages snippet is calling modX::parseChunk() which expects two parameters, the chunk name and an array of placeholders to parse into the chunk.

      In the case of getImages, it's only passing the first parameter and not the second (the array of placeholders) - the correct call in this instance seems like it would be modX::getChunk() where the second parameter is optional.

      Suffice to say, you should be able to get rid of the warning by switching the parseChunk() call on that line of the snippet to use getChunk() instead. Or, if that doesn't work, try passing in the $modx->placeholders array as the second argument to parseChunk().

      [ed. note: garryn last edited this post 9 years, 10 months ago.]
        Garry Nutting
        Senior Developer
        MODX, LLC

        Email: [email protected]
        Twitter: @garryn
        Web: modx.com
        • 47838
        • 6 Posts
        Garry was right as usual! =]
        I change parseChunk() to getChunk() on the for loop and the page render.
        It also wasn't working for me to begin with, after debugging, I noticed the // out line for getting the folder placeholder. It was using $_GET and once i switched that it worked.
          MODX Front End Dev