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

    I am using Revo 2.2.9 and everything has been working perfectly for a while. This morning however when the client tries to open the home page (ID=1) in the MODX Manager, MODX displays a completely blank white screen. All other resources are fine, it is just this one page that has a problem. I have cleared the cache, both through MODX and deleted everything in the core/cache directory but this makes no difference.

    The following errors appear in the log, but they are not related to the time that i try to access the 'broken' MODX resource, so i don't believe are related (though may be wrong):

    [2013-11-11 09:32:36] (ERROR @ /usr/local/home/httpd/vhtdocs/domainname.co.uk/core/components/migx/model/migx/migx.class.php : 1655)
    PHP warning: Parameter 2 to array_multisort() expected to be a reference, value given
    
    [2013-11-11 09:35:02] (ERROR @ /usr/local/home/httpd/vhtdocs/domainname.co.uk/core/cache/includes/elements/modplugin
    /6.include.cache.php : 106) PHP warning: Cannot modify header information - headers already sent by (output started at /usr/local
    /home/httpd/vhtdocs/domainname.co.uk/core/model/modx/modresponse.class.php:189)
    
    


    This is a massive problem for me - if anyone can shed any light or suggestions i would much appreciate it
    Many thanks
      • 36818
      • 119 Posts
      Hi Emily,

      Is MIGX used on the home page (ID=1)? I would check, if MIGX is working or not. Can you comment it out?
      Without knowing any further details, it was just what came up my mind.

      Fabian
        • 8822
        • 203 Posts
        Thanks Fabian, To be fair it actually looks like the template file has become completely corrupted or is causing some massive problem. If i take a copy of the template and remove everything from in it, any page using that template will still display a blank page (500 Server Error). If i create a new template though and copy the content of the corrupted template to it then it works fine...... can a template become corrupted like that?

        The simple thing would be to re-assign a new template to my resource, but as i am unable to get in and edit that resource i have no idea how to do that without creating a new resource. As the page in question is the home page it would mean updating an awful lot of references throughout the site and i don't want to do that.

        Any suggestions on how to update a page template when you can't get into that page? OR how to fix a corrupt page template?
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Yes, I've had that happen before. I had to duplicate the template, assign the resources to the new template, then I could delete the bad template. Actually it also involved a corrupted TV - although I'm not sure exactly which was corrupted, the template or the TV. I used the Batcher extra to shift the resources to the new template.
            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
            • 8822
            • 203 Posts
            Thanks Susan - that was what i thought i was going to have to do.......the page is the home page though (ID 1) and i didn't really want to change that - the default/home page is referenced in a lot of places and it would involve updating a lot of references. Is there anyway of manually changing the ID of a resource do you know, so that i could still have the home page as ID=1?
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              You can, in this case, go to the database and manually change the resource ID of the new one to 1. Generally this is most definitely not recommended, since the ID is used in all sorts of ways and should be left alone. But in this case, the original resource #1 is deleted, and you need a resource #1 if you're not going to make a lot of tedious changes to configuration settings and other uses of that #1. Likewise the template, if you delete the original and create a new one, you can change its ID to the one you deleted. That way you don't need to change the template assignment of any resources, they'll be getting the template with the same ID.
                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
                • 8822
                • 203 Posts
                Thanks Susan, with further investigation it would appear that the problem is two of the TVs assigned to the template - if they are both assigned to the template then the problem occurs, if either of them isn't then the problem doesn't occur - why they work on their own though i don't know, i would have thought they either cause the problem or they don't, but they obviously cause the problem when assigned together. I have tried creating new TVs exactly the same (not duplicating), but the same problem still occurs so again i am a little stumped as to what the problem is - one is a resource list TV which is used to link the user to that specific page and the other is an image TV. Ever come across something similar?
                  • 3749
                  • 24,544 Posts
                  I would first try repairing all tables in the DB in PhpMyAdmin.

                  FYI, It shouldn't matter what the ID of the home page is. All links to the home page should be in this form:

                  <a href="[[~[[++site_start]]]]">Link text</a>


                  It's possible that it's not the template itself but the template field of the resource pointing to a non-existent template, though what it looks most like is that a MIGX plugin is throwing an E_NOTICE error.

                  If that's it, Disabling the plugin and deleting all files in the core/cache directory would make it go away.
                    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
                    • 8822
                    • 203 Posts
                    Infact, if i change the image TV type to something else, i.e. Text, then it all works again!!!
                      • 3749
                      • 24,544 Posts
                      That's definitely a weird problem. I missed the part of your OP about the error not happening at the same time as the issue.

                      Try doing a "view source" on the page with each TV alone and see if there's anything odd about the HTML being produced by the TV (like a missing closing quote or > ).

                      If you don't see anything, you could try running the page, with each TV working alone, though the validator at: http://validator.w3.org/. If both are valid, try running the page with both TVs.
                        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