We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36047
    • 30 Posts
    Hi everybody! Probably i am to tired or to blind to see where is the problem, but i’m watching really strange behavior in my 404 error page.

    So, i almost finished my new project and decided to make my own "404 error page" for it. I created a new resource and separate empty template and set this resource for error_page in settings.

    Next i simply wrote my "error text" inside of template.

    The problem is: when i open the page which not exists, i see my text from template, but before this text there is some strange symbols as well as after the text.

    You can see it on this screenshot.
    https://www.dropbox.com/s/gd5xqjqc0o37n0u/dsfdsgsdg30.jpeg?dl=0

    Also, i found out, that those symbols are changing when i change the text within my template (look at the next screenshot)
    https://www.dropbox.com/s/mram9v7bxw1yc8n/dsfdsgsdg31.jpg?dl=0

    The same happens when i change a template for some other, but in this case these symbols appear before "<!DOCTYPE" and after "</html>"

    My system is MODX Revo 2.3.3.
    I`m facing this problem on my local xampp and on my webhosting server.

    Does anybody know how can i fix it, or where do i have to dig?
    Gratefull for any help.
    Thanks!

    This question has been answered by spbox. See the first response.

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Usually I use the same base template for error pages that I do with regular pages. You don't need anything special for a Not Found page.

      Do you have any plugins that are using the OnPageNotFound event? What happens if you test by using one of your regular pages as the Not Found page in the system settings?
        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
        • 36047
        • 30 Posts
        Hello! Thanks a lot for your attention to my issue.
        Usually i`m using the same template for error pages that I use with regular pages too.

        Here i tried to use both - new simple empty template (previous screenshots) and the template for regular pages , but happens the same, only the symbols are different.

        They appear before "<!DOCTYPE" in my header and after "</html>" in footer, so it looks like this (screenshots below):
        https://www.dropbox.com/s/aesms47zet28ryd/dsfdsgsdg33.jpeg?dl=0
        https://www.dropbox.com/s/vw1cugzdcoyu5qd/dsfdsgsdg34.jpeg?dl=0

        First i thought that i have some missed or unclosed tags in my templates, i checked it several times, so i decided to try empty template without any html, but still the same trouble.

        Testing it by using one of my regular pages doesn't give any effect.

        As for OnPageNotFound, could you, please, tell me how can i check it?

        Here is the list of the extras i use:
        Batcher 1.1.1-pl
        Breadcrumbs 1.1.0-pl
        FormIt 2.2.0-pl
        Gallery 1.7.0-pl
        getPage 1.2.4-pl
        getResources 1.6.1-pl
        Login 1.9.0-pl
        modxTalks 1.0.3-beta
        Polls 1.3.2-pl
        pThumb 2.3.3-pl
        resizer 1.0.1-pl
        SimpleSearch 1.9.2-pl
        TinyMCE 4.3.3-pl
        translit 1.0.0-beta
        Wayfinder 2.3.3-pl

        I know it looks monstrous, but i need each of them for this project.

        Also, i can`t trace any error with my browser console during load the page.
          • 36047
          • 30 Posts
          Update:
          I found which plugin is using OnPageNotFound. The one is MODXTalksPlugin. But still can`t figure it out how to fix.

          Here the part of the code:
          case 'OnPageNotFound':
                  // Check whether active friendly_urls, if not, then the interrupt
                  if ($modx->getOption('friendly_urls') != 1) break;
          
                  $corePath = $modx->getOption('modxtalks.core_path',null,$modx->getOption('core_path').'components/modxtalks/');
                  require_once $corePath.'model/modxtalks/modxtalksrouter.class.php';
                  $routermt = new modxTalksRouter($modx);
                  $routermt->route();
                  break;


          I tried to remove this part from the code, but no luck, so i`m not sure that plugin cause the problem. [ed. note: spbox last edited this post 11 years, 6 months ago.]
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            The best way to test it is to simply disable the plugin, then see if you still have the problem. Make sure the cache is cleared before trying a not-found page again.
              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
              • 36047
              • 30 Posts
              Thanks again for your time, i did exactly as you said, i even cleared the cache folder manually, but it not helped((
              I`ll try to reinstall my MODX now and write about the result.
                • 32699 ☆ A M B ☆
                • 427 Posts
                Each context can have its own 404 page with the error_page setting. I don't really see why a plugin of any kind would be required. Wayfinder, pdoMenu, getResources, sitemap, and other Packages should serve almost any need.

                You can right-click on your plugin and disable it.

                You can also create a new 404 page, change the context value in the settings. Clear the site cache. And start from scratch without having to reinstall.

                Delete the old 404 page.
                  Get your copy of MODX Revolution Building the Web Your Way http://www.sanitypress.com/books/modx-revolution-building-the-web-your-way.html

                  Check out my MODX || xPDO resources here: http://www.shawnwilkerson.com
                  • 36047
                  • 30 Posts
                  Quote from: wshawn at Mar 04, 2015, 01:16 PM
                  Each context can have its own 404 page with the error_page setting. I don't really see why a plugin of any kind would be required. Wayfinder, pdoMenu, getResources, sitemap, and other Packages should serve almost any need.

                  You can right-click on your plugin and disable it.

                  You can also create a new 404 page, change the context value in the settings. Clear the site cache. And start from scratch without having to reinstall.

                  Delete the old 404 page.

                  Hello, W. Shawn Wilkerson, thanks for joining us in this topic. I already made a new 404 page and removed the old one, cleared the site cache of course, but unfortunately no good results. I still getting this symbols in my new page.

                  And what do you mean by "change the context value in the settings"?
                    • 36047
                    • 30 Posts
                    No result after reinstalling. I keep searching for solution.
                      • 32699 ☆ A M B ☆
                      • 427 Posts
                      Quote from: spbox at Mar 04, 2015, 01:40 PM
                      Quote from: wshawn at Mar 04, 2015, 01:16 PM

                      And what do you mean by "change the context value in the settings"?

                      You stated in the original post that you had used the old Resource ID as the 404 page in the settings. If you create a new page you need to change that setting to point to the new page.

                      The 16 and 0 being returned to the page are a result of something called within the page. Look there.
                        Get your copy of MODX Revolution Building the Web Your Way http://www.sanitypress.com/books/modx-revolution-building-the-web-your-way.html

                        Check out my MODX || xPDO resources here: http://www.shawnwilkerson.com