We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 727
    • 502 Posts
    I have a template called "default" and a template called "block".

    If I create a page using the default template, then I can access it with:

    http://www.foo.com/index.php?id=40

    If I change the template to block, then accessing the pages gives 404 Not Found.

    If I then change the template back to default it works again.

    This is with 0.9.6.1 and friendly URLs turned off. The templates are identical except block has two TVs. Any ideas??!??

    Andy
      • 727
      • 502 Posts
      Found the problem. On these pages a snippet was executing with:

      $modx->getDocumentObject('id', '');


      which obviously won’t work. Would be nice if there was better error feedback. How do most people debug their snippets?

      Andy
        • 19164
        • 1,215 Posts
        You can insert all the code to php file and include this file in the snippet by include or require commands. So you can to debug your code with debugger. And as a bonus - size of the cache file will be decreased.
          DirectResize 0.9 beta. PHPThumb, sets of configurations, configuration, binded to specific path. No backward compatibility. | DirectResize 0.9. PHPThumb, наборы параметров, параметры, привязанные к определенным путям. Без обратной совместимости.

          Unfortunately, DirectResize project is closed. If you want to continue development, PM me for access to project page on Google Code. К сожалению, проект DirectResize закрыт. Если вы желаете продолжить разработки, обращайтесь через ПМ для получения доступа к репозиторию на Google Code.

          [PLUGIN] DirectResize - as Maxigallery but for single images :: Download :: [url=http://modxcms.com/forums/index.php/topic,21490]
          • 727
          • 502 Posts
          Yes, but that wouldn’t make MODx output error messages, would it?

          Andy
            • 19164
            • 1,215 Posts
            Which messages do you mean? You can process all the errors with your debugger.
              DirectResize 0.9 beta. PHPThumb, sets of configurations, configuration, binded to specific path. No backward compatibility. | DirectResize 0.9. PHPThumb, наборы параметров, параметры, привязанные к определенным путям. Без обратной совместимости.

              Unfortunately, DirectResize project is closed. If you want to continue development, PM me for access to project page on Google Code. К сожалению, проект DirectResize закрыт. Если вы желаете продолжить разработки, обращайтесь через ПМ для получения доступа к репозиторию на Google Code.

              [PLUGIN] DirectResize - as Maxigallery but for single images :: Download :: [url=http://modxcms.com/forums/index.php/topic,21490]
              • 727
              • 502 Posts
              The problem in this situation is that I didn’t know where the error was occuring. I have a lot of snippets but only one was causing a problem. How would I know which snippet to look at? I didn’t even know that it was a snippet at first. MODx was simply returning a 404 error.

              Andy
                • 19164
                • 1,215 Posts
                All of what I wrote, it is useful for debugging your own snippets. Debuging of ebmded snippets is realy problematic. I don’t know simple method to do it.
                  DirectResize 0.9 beta. PHPThumb, sets of configurations, configuration, binded to specific path. No backward compatibility. | DirectResize 0.9. PHPThumb, наборы параметров, параметры, привязанные к определенным путям. Без обратной совместимости.

                  Unfortunately, DirectResize project is closed. If you want to continue development, PM me for access to project page on Google Code. К сожалению, проект DirectResize закрыт. Если вы желаете продолжить разработки, обращайтесь через ПМ для получения доступа к репозиторию на Google Code.

                  [PLUGIN] DirectResize - as Maxigallery but for single images :: Download :: [url=http://modxcms.com/forums/index.php/topic,21490]