Upgrade to Perch 3 existing pages blank

  • drewm

    Approved the thread.
  • I have no idea how I resolved this! I think I backed off on upgrading. Now I am running php 7 and when I upgraded perch, because I had to, I get the blank page again. the php error log says this


    [16-Dec-2019 09:24:42 America/Los_Angeles] PHP Fatal error: Cannot redeclare perch_content() (previously declared in /home/parking/www/dev/perch/core/apps/content/runtime.php:18) in /home/parking/www/dev/perch/core/apps/content/runtime.php on line 42

  • in looking at one of my content regions in perch, it is also giving me errors about disallowed characters. we can't use hyphens anymore?


    Template tag ID ‘staff-photo’ contains disallowed characters


    <img style="float: left; padding: 0px 10px 10px 0px;" src="<perch:content id="staff-photo" type="image" label="Photo" />" width="90" height="108" />

  • I get a blank page for another page that isn't showing errors in perch, so I am stumped. Because I can't hit the page after adjusting the template (removing hyphens from id names), I also can't resolve the 'disallowed characters' message. it seems that there are several issues. Let me know what I should do, thanks!

  • just to clarify, the above errors have to do with perch 3 running on my dev site (running php7). On live, I have downgraded perch, so that public pages render, but admin is not usable, because I've upgraded to php 7.


    also, to ensure that the dev site was using a separate database from live, I modified the dev config.php file to point to the dev database not the live database.

  • Hi


    You’ve never been able to use hyphens in templates.


    What Is you php error log telling you? A blank page usually means a php error so turning on display errors for your dev server is a good start.

    Sharing your diagnostics and relevant templates is also helpful if someone is going to help you out.

    Jon

  • as posted above, here's the php error.

    [16-Dec-2019 09:24:42 America/Los_Angeles] PHP Fatal error: Cannot redeclare perch_content() (previously declared in /home/parking/www/dev/perch/core/apps/content/runtime.php:18) in /home/parking/www/dev/perch/core/apps/content/runtime.php on line 42


    as posted above, here's a template content snippet which has a hyphen and which has been used successfully for over five years on previous perch versions.

    <img style="float: left; padding: 0px 10px 10px 0px;" src="<perch:content id="staff-photo" type="image" label="Photo" />" width="90" height="108" />

  • I resolved this issue by copying new files over everything in perch/config except for the config.php file itself. (which has custom access info for the db)...specifically the config/apps.php file, overwriting that fixed my error and Perch 3 is now functional.


    There appears to be a typo in the Perch 2 to 3 upgrade instructions (https://docs.grabaperch.com/perch/upgrading/) which makes it a little confusing as to how to proceed. It says the following:


    "2. Check your apps file

    If you have a very old install to upgrade, your perch/config/config.apps file might contain lots of include() statements. You need to update it or you’ll get errors. A basic starting point apps.php file looks like this:"


    note: the filename is not "config.apps", it is "apps.php"


    My apps.php file had a call to the runtime.php file; no idea why, perhaps it's left over from a very old version of Perch or I kludged that in there when I had trouble upgrading between Perch 1 and 2...who can say, it's been too long. Anyway. I don't use add-on apps, so I didn't need anything in apps.php, basically.


    As for hyphens in content ID names, after I removed the hyphens and hit the public page, I was able to work with it in Perch. I don't know when you stopped supporting hyphens but certainly it always worked in Perch 2.