We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51360
    • 6 Posts
    I have upgraded MODX to 2.6.5. using Upgrade MODX Extra. I manually cleared cache (removed all content of core/cache/ folder) before upgrade started. During upgrade, everything went well. After upgrade manager works, but when I try to display my webpage, the following error occurs.

    Fatal error: Uncaught Error: Call to a member function get() on null in /data/web/virtuals/171018/virtual/www/core/cache/includes/elements/modsnippet/4.include.cache.php:8 Stack trace:
    #0 /data/web/virtuals/171018/virtual/www/core/model/modx/modscript.class.php(70): include()
    #1 /data/web/virtuals/171018/virtual/www/core/model/modx/modparser.class.php(536): modScript->process()
    #2 /data/web/virtuals/171018/virtual/www/core/components/pdotools/model/pdotools/pdoparser.class.php(273): modParser->processTag(Array, true)
    #3 /data/web/virtuals/171018/virtual/www/core/model/modx/modparser.class.php(250): pdoParser->processTag(Array, true)
    #4 /data/web/virtuals/171018/virtual/www/core/components/pdotools/model/pdotools/pdoparser.class.php(65): modParser->processElementTags('[[pdoMenu@mainM...', 'pdoMenu@mainMen...', true, false, '[[', ']]', Array, 0)
    #5 /data/web/virtuals/171018/virtual/www/core/model/modx/modparser.class.php(430): pdoParser->processElementTags('[[pdoMenu@mainM...', 'pdoMenu@mainMen...', true)
    #6 /data/web/virtu in /data/web/virtuals/171018/virtual/www/core/cache/includes/elements/modsnippet/4.include.cache.php on line 8

    This occurs on any URL of my web, clearing cache doesn't help either... Does anyone has any idea, what a problem can be?
    My web page: http://kp58.cz

    regards,
    Jan Lochman.
    • What snippet has ID 4? pdoMenu? Try updating pdoTools to 2.11.2.

      What MODX version did you upgrade from?
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 51360
        • 6 Posts
        I have updated from MODX 2.5.2. pdoTools are already updated to the newest version.

        Snippet with ID 4 is getMegaMenu, which is specific to template I am using. Here is the erroneous code from it (used variables aren't used in the previous part of the snippet)

            echo $resId;
            $parent = $modx->getObject('modResource', array('id' => $resId,))->get('parent');
        


        $modx->getObject(...) returns null, so this is where the problem originates from. I am not sure, why this happens. Here is the chunk, which calls the snippet

                          [[pdoMenu@mainMenu?
                            &startId=`0`
                            &tplParentRow=`@INLINE [[!getMegaMenu? &resId=`[[+id]]` &type=`getClasses` &place=`tplParentRow` &link=`[[+link]]` &menutitle=`[[+menutitle]]` &wrapper=`[[+wrapper]]` &attributes=`[[+attributes]]` &classnames=`[[+classnames]]` &classes=`[[+classes]]`]]`
                            &tplParentRowHere=`@INLINE [[!getMegaMenu? &resId=`[[+id]]` &type=`getClasses` &place=`tplParentRowHere` &link=`[[+link]]` &menutitle=`[[+menutitle]]` &wrapper=`[[+wrapper]]` &attributes=`[[+attributes]]` &classnames=`[[+classnames]]` &classes=`[[+classes]]`]]`
                            &tplParentRowActive=`@INLINE [[!getMegaMenu? &resId=`[[+id]]` &type=`getClasses` &place=`tplParentRowActive` &link=`[[+link]]` &menutitle=`[[+menutitle]]` &wrapper=`[[+wrapper]]` &attributes=`[[+attributes]]` &classnames=`[[+classnames]]` &classes=`[[+classes]]`]]`
                            &tpl = `@INLINE [[!getMegaMenu? &resId=`[[+id]]` &type=`getClasses` &place=`tpl` &link=`[[+link]]` &menutitle=`[[+menutitle]]` &wrapper=`[[+wrapper]]` &attributes=`[[+attributes]]` &classnames=`[[+classnames]]` &classes=`[[+classes]]`]]`
                            &tplOuter=`@INLINE [[+wrapper]]`
                            &tplInner=`@INLINE [[+wrapper]] [[!getMegaMenu? &resId=`[[+id]]` &type=`setMenu`]]`
                          ]]
        


        Surprisingly (at least for me), echo $resId, which I added to the snippet, prints [[+id]] and not the numeric id of resource. Is this expected?
        [ed. note: quantorum last edited this post 5 years, 8 months ago.]