We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12300
    • 12 Posts
    I have a fresh install of Modx 0.9.6.1p2 in a couple of websites that are working fine, but the error log shows one error over and over:

    [25-Feb-2008 07:16:20] PHP Parse error: syntax error, unexpected T_VARIABLE in /etc/public_html/manager/includes/document.parser.class.inc.php(745) : eval()’d code on line 51

    In neither install did I create a template variable. Any idea what this could be... and how I can fix it?

    Thanks,

    H
    • Did you install any snippets or is this after the default install of the website? It looks like an error in a snippet that is likely missing a ; somewhere likely before line 51. I am not a core expert and someone else may be able to provide more accurate info but it seems a likely issue.

      Cheers,

      Jay
        Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. BlogTwitterLinkedInGitHub
        • 10449
        • 956 Posts
        Check if you’ve got the "search highlight" snippet installed. Somewhere at the end of that snippet there’s a missing ;
        Add that semicolon or remove the snippet altogether.
          • 12300
          • 12 Posts
          The basic install pops in a variety of snippets, but the only snippet I’m using is AjaxSearch - 1.6.

          [!AjaxSearch? &ajaxSearch=`0` &AS_landing=`2`!]

          I do have the "XHTML URLs" option selected... could the presence of "&" instead of "&" in the pages set something like that off?

          The only tweak I make to Ajax Search is the results page: $resultsPage = 2;

          Should I be looking for the problem in the snippets? The page code? or that parser.etc. in the includes file?

          H
          • Tempate Switcher is a plugin, not a snippet. You can simply disable it, or completely remove it. I wrote it years ago for a specific site, and it was thought to be a good idea to include it in the demo content to facilitate exploring the different templates that are included. It’s not really a good idea to have it hanging around when it’s not specifically being used. Especially with a missing ; in the code!
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 12300
              • 12 Posts
              I don’t see the template switcher in the plug ins... but I do see the search highlighting plug in. Can I just delete that if I’m not using it?



              * Bottom Button Bar - Adds a set of buttons to the bottom of all manager pages
              * Forgot Manager Login - Resets your manager login when you forget your password.
              * Inherit Parent Template - New docs automatically select template of parent folder
              * QuickEdit - Front-end Content Editor.
              * Search Highlighting - 1.2.1: Show search terms highlighted on page linked from search results. (Requires AjaxSearch snippet)
              * TinyMCE - 2.1.2: TinyMCE RichText Editor Plugin
              • Yes, sorry, I had it confused with another specific-use plugin that was also known to cause problems. I believe that the template switcher has been removed from the default installation in the more recent versions. The search word highlighter just has that one error in the code; otherwise it works fine.
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 12300
                  • 12 Posts
                  smiley I disabled the plug-in Ajax Search highlighting, reset the error log, and then did a random click through the front and back end of the website... it appears that the error log is no longer logging the parsing error, so I think that might have done the trick. Thanks, everyone, for such prompt replies!!

                  H
                    • 31178
                    • 128 Posts
                    Quote from: sottwell at Feb 25, 2008, 03:53 PM

                    Yes, sorry, I had it confused with another specific-use plugin that was also known to cause problems. I believe that the template switcher has been removed from the default installation in the more recent versions. The search word highlighter just has that one error in the code; otherwise it works fine.

                    Susan,
                    I also came across this error with a recent 0.9.6.1p2 install. I disabled the ’Search Highlighting’ plugin and all was well. You indicated there was ’just one error in the code’. Do you know of a fix for this? It is not just having the errors in the log, one side-effect of the error is it messes with TinyMCE by preventing the TinyMCE Predefined Template addon from working correctly unless I disable this search highlighting plugin.

                    Thanks,
                    Richard
                      • 10449
                      • 956 Posts
                      it’s really just a missing ; at the end of a line in that script (iirc, line 52 - almost at the end).