We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36720
    • 20 Posts
    Hi Modxers,

    I moved my website from localhost to a server and now I get the following errors diplaying on the page:

    Parse error: syntax error, unexpected ')' in /web/htdocs/www.intranetplanet.net/home/hrm20/demo/core/model/modx/filters/modoutputfilter.class.php(158) : eval()'d code on line 1

    Parse error: syntax error, unexpected ')' in /web/htdocs/www.intranetplanet.net/home/hrm20/demo/core/model/modx/filters/modoutputfilter.class.php(166) : eval()'d code on line 1

    After these errors, the page works perfectly producing the requested effect, but I need to cancel this error message.

    The resource code is the following:

    <h1>Job Portal Edit</h1>
    <p>
    [[!+modx.user.id:memberof=`[[*TV_module]]`:then=`
    [[!NewsPublisher? 
       &parentid=`[[*TV_idparent]]` 
       &cancelid=`[[*TV_idparent]]` 
       &initrte=`1` 
       &rtcontent=`1` 
       &template=`intra` 
       &aliastitle=`1` 
       &published=`1` 
       &searchable=`1` &show=`pagetitle,longtitle,description,content,TV_tag,pub_date,unpub_date,TV_aside,TV_module,TV_idparent,TV_idedit,TV_idarchtrgt` ]]
    `:else=`
    <div class="notice warning brdr btmspc">Siamo spiacenti, ma non sei autorizzato ad accedere alla pagina.</div>
    `]]
    </p>
    



    I'm using:
    Modx Revo 2.1.3
    MySQL: 5.0.92 (client API version 5.1.56)
    PHP 5.2.17

    I guess it's something about server settings, because it worked perfectly on localhost.
    Many thanks in advance
    Bye

    gianni


      • 3749
      • 24,544 Posts
      It might be an issue with having a complex output modifier on multiple lines. You might try putting the whole tag on one line.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 36720
        • 20 Posts
        Hi Bob, thanks,

        tried without success.
        The error shows only when the "else" condition is true, even if the correct div appear on the page.

        Maybe using chunks instead of full code ? I'll try.
        Bye
        gianni
          • 36720
          • 20 Posts
          No results with chunks as well.

          Any ideas ?

            • 3749
            • 24,544 Posts
            Are you using CodeMirror, by chance? I've seen it leave in invisible parentheses.

            Another possibility is that the core/model/modx/filters/modoutputfilter.class.php file got corrupted in the transfer.

            This (I think) would be the snippet version, which might be faster (with just the NewsPublisher tag in a chunk called NewsPublisherChunk):

            [[ShowNewsPublisher? &group=`[[*TV_module]]` ]]


            <?php
            /*ShowNewsPublisher Snippet */
            
            if ($modx->user->isMember($scriptProperties['group']) ) {
               $output =  $modx->getChunk('NewsPublisherChunk');
            } else {
               $output =  '<div class="notice warning brdr btmspc">Siamo spiacenti, ma non sei autorizzato ad accedere alla pagina.</div>';
            }
            return $output;
            
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 36720
              • 20 Posts
              Great Bob, it works, many thanks !

              I have to learn php or at least the use of modx functions, your code is very simple to read.

              One last issue: snippet correctly traps users permissions, BUT for users not member of the "TV_module" group it displays the standard NewsPublisher message instead of the div in Italian. Suggestions ?

              Grazie ancora

              Gianni



                • 37210
                • 131 Posts
                insightdesign Reply #7, 11 years ago
                [quote author=BobRay date=1317357115]Another possibility is that the core/model/modx/filters/modoutputfilter.class.php file got corrupted in the transfer.

                Woot woot!

                I know this post is really old...but this solved my problem. I was having the same error after a backup of our website was restored.

                Thanks BobRay!..and of course giannirapetti for bringing the question up!