Forum
Error after upgrade from Perch version 2.1 to latest version 3
After replacing the old perch/core with the new one and logging into Perch om my site, I got a message saying that the upgrade had been successful and I can navigate to my page definitions etc. However, when running the site, if I click on any page which has a perch_content call I get a page with no content but with a php error message thus: Fatal error: Cannot redeclare perch_content() (previously declared in /home/dom14674/public_html/perch/core/apps/content/runtime.php:18) in /home/dom14674/public_html/perch/core/apps/content/runtime.php on line 18
I see that the declaration of the perch_content function at line 18 is indeed different from that in version 2.1 but I don't understand how his double delaration is arising.
Can you show us the content of your
config/apps.php
file?<?php include(PERCH_PATH.'/core/apps/content/runtime.php'); ?>
Take a look at the upgrade instructions here, particularly the section "Check your apps file"
https://docs.grabaperch.com/perch/upgrading/
I think you just need to update the content of that file and you should be good to go.
Thank you Drew. My config/apps.php file now contains just <?php $apps_list = [ ]; ?> and everything is fine. What confused me was this line in the upgrading documentation, "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." The file name should surely be corrected to perch/config/apps.php.