We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9549
    • 93 Posts
    Does anyone experience problems to get sottwell’s SetLangCookie multilingual method to work in MODx 0.9.5? It seems that the TV doesn’t catch up on the created cookie...

    SetLang TV:

    @EVAL
    if($modx->documentObject[’parent’] == 0) {
    $lang=$modx->documentIdentifier;
    }
    else
    if(isset($_COOKIE[’Language’])) {$lang=$_COOKIE[’Language’];}
    else {$lang=$modx->config[’site_start’];}
    return $lang;


    In 0.9.2 it works just fine..
      • 9549
      • 93 Posts
      Further investigation tells me that not even the simplest @EVAL php executes. I tried @EVAL return “The time stamp is now ”.time(); as from the documentation and it doesn’t show in the output. What could be wrong? It’s driving me nuts!
        • 21475
        • 80 Posts
        Hi!

        I have the same problem with @EVAL. Does not seem to work anymore in 0.95?
        Comment in php code return an error. And when i try @EVAL with php code and no comments, i get no error, but i have no outputs... and this was working well in 0.92.
        Any clue?

        Thanks in advance for your answers...
          • 21475
          • 80 Posts
          Hi,
          My TVs are still broken. Anyone have a solution?
          FYI, i’ve updated from 0.92 to 0.95 without any error, except for my TVs... :’(
          PHP code isn’t executed...
          Thanks in advance for any answers!
            • 9549
            • 93 Posts
            We sit in the same boat! I’m also waiting for a solution...
              • 22303 MODX Staff
              • 10,725 Posts
              If you are having this problem, please open up /manager/includes/tmplvars.commands.inc.php and edit line 126 from...
              	$regexp = '/@('.implode('|',$BINDINGS).')\s*(.*)/i'; // Split binding on whitespace
              ...to...
              	$regexp= '/@(' . implode('|', $BINDINGS) . ')\s*((.|\s)*)/i'; // Split binding on whitespace
              ...and let me know if that changes the @EVAL behavior.

              NOTE: edited from original (2x)!
                • 21475
                • 80 Posts
                Hello Opengeek,

                I did what you wrote, but nothing more happens for my TV...

                Thanks for your help!
                  • 22303 MODX Staff
                  • 10,725 Posts
                  Ok, I edited the post with the change instructions. Please try the new regexp in my previous post and that should make it work again.

                  Also, please note I added bug report #732 to track this critical issue.
                    • 21475
                    • 80 Posts
                    Opengeek,

                    if ihave an error :
                    « MODx Parse Error »
                    MODx encountered the following error while attempting to parse the requested resource:
                    « PHP Parse Error »
                     
                    PHP error debug
                      Error: 	implode(): Bad arguments.	 
                      Error type/ Nr.: 	Warning - 2	 
                      File: 	/***/manager/includes/tmplvars.commands.inc.php	 
                      Line: 	126	 
                      Line 126 source: 	$regexp= '/@(' . implode('|', $this->bindings) . ')\s*((.|\s)*)/i'; // Split binding on whitespace 	 
                     
                    Parser timing
                      MySQL: 	0.0067 s	(8 Requests)
                      PHP: 	0.5398 s	 
                      Total: 	0.5465 s


                    Thanks smiley
                      • 22303 MODX Staff
                      • 10,725 Posts
                      Ugh, might help if I pay attention to which version I’m copying and pasting from...I accidentally pasted the fix from my 0.9.7 branch. tongue

                      Post edited one more time. My apologies for the confusion.