Forum

Thread tagged as: Problem, Error

Regions not working/disappearing for specific URL

I have a really weird scenario where regions are not showing in admin to edit or outputting on the page if the page location is has a certain folder name/location (courses/acma/index.php). The page is using a master page template that many other pages use without problem. If I change the page location (Eg. courses/acma2/index.php) all of a sudden the regions appear, I can add content and it is output on the page. If I change back, the regions still show up in admin, but they are not output on the page. Any ideas?

The debug from the web page where the regions are not outputting...

Debug Message
[1] SELECT * FROM perch2_pages WHERE pagePath='/courses/acma/index.php' LIMIT 1
[10] SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/courses/acma/index.php' OR regionPage='*' ORDER BY regionPage DESC
Using template: /templates/pages/attributes/default.html
Using sub-template: /templates/pages/attributes/seo.html
Using sub-template: /templates/pages/attributes/facebook.html
Using sub-template: /templates/pages/attributes/twitter.html
[67] SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 ORDER BY pageTreePosition ASC
[1] SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/courses/acma/index.php' LIMIT 1
[2] SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-002-001', '000-002', '000') ORDER BY pageTreePosition DESC
Using template: /templates/navigation/level1.html
[6] Using template: /templates/navigation/level2.html
[6] Using template: /templates/navigation/level2.html
[6] Using template: /templates/navigation/level2.html
[1] SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/courses/acma/index.php' OR pageSortPath='/courses/acma/index.php' LIMIT 1
[2] SELECT * FROM perch2_pages WHERE pageHidden=0 AND pageNew=0 AND pageTreePosition IN ('000-002-001', '000-002', '000') ORDER BY pageTreePosition
[2] Using template: /templates/navigation/breadcrumbs.html
[1] SELECT pageID, pageParentID, pageDepth, pageTreePosition FROM perch2_pages WHERE pagePath='/courses/acma/index.php' OR pageSortPath='/courses/acma/index.php' LIMIT 1
[4] SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 AND pageTreePosition LIKE '000-002-001%' AND pageDepth >=2 AND pageDepth<=3 ORDER BY pageTreePosition ASC
[1] SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/courses/acma/index.php' LIMIT 1
[2] SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-002-001', '000-002', '000') ORDER BY pageTreePosition DESC
[3] Using template: /templates/navigation/item.html
[1] SELECT pageID, pageParentID, pageDepth, pageTreePosition FROM perch2_pages WHERE pagePath='/courses' OR pageSortPath='/courses' LIMIT 1
[7] SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 AND pageTreePosition LIKE '000-002%' AND pageDepth >=1 AND pageDepth<=2 ORDER BY pageTreePosition ASC
[1] SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/courses/acma/index.php' LIMIT 1
[2] SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-002-001', '000-002', '000') ORDER BY pageTreePosition DESC
Using template: /templates/navigation/footer_menu.html
[1] Using template: /templates/navigation/item.html
[1] SELECT pageID, pageParentID, pageDepth, pageTreePosition FROM perch2_pages WHERE pagePath='/qualifications' OR pageSortPath='/qualifications' LIMIT 1
[7] SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 AND pageTreePosition LIKE '000-003%' AND pageDepth >=1 AND pageDepth<=2 ORDER BY pageTreePosition ASC
[1] SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/courses/acma/index.php' LIMIT 1
[2] SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-002-001', '000-002', '000') ORDER BY pageTreePosition DESC
Using template: /templates/navigation/footer_menu.html
[1] Using template: /templates/navigation/item.html
[1] SELECT pageID, pageParentID, pageDepth, pageTreePosition FROM perch2_pages WHERE pagePath='/information' OR pageSortPath='/information' LIMIT 1
[9] SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 AND pageTreePosition LIKE '000-006%' AND pageDepth >=1 AND pageDepth<=2 ORDER BY pageTreePosition ASC
[1] SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/courses/acma/index.php' LIMIT 1
[2] SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-002-001', '000-002', '000') ORDER BY pageTreePosition DESC
Using template: /templates/navigation/footer_menu.html
[1] Using template: /templates/navigation/item.html

Diagnostics:

Perch: 2.8.28, PHP: 5.6.10, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $, with PDO
Server OS: Darwin, apache2handler
Installed apps: content (2.8.28), assets (2.8.28), categories (2.8.28), perch_forms (1.8.3)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_forms', );
PERCH_LOGINPATH: /rt_admin
PERCH_PATH: /Users/bradhardinge/Documents/clients/ramsdentraining/site/production/rt_admin
PERCH_CORE: /Users/bradhardinge/Documents/clients/ramsdentraining/site/production/rt_admin/core
PERCH_RESFILEPATH: /Users/bradhardinge/Documents/clients/ramsdentraining/site/production/rt_admin/resources
Image manipulation: GD
PHP limits: Max upload 32M, Max POST 32M, Memory: 128M, Total max file upload: 32M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
HTTP_HOST: ramsdentraining.dev
DOCUMENT_ROOT: /Users/bradhardinge/Documents/clients/ramsdentraining/site/production
REQUEST_URI: /rt_admin/core/settings/diagnostics/
SCRIPT_NAME: /rt_admin/core/settings/diagnostics/index.php
Brad Hardinge

Brad Hardinge 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

It looks like it's finding 10 regions for that page. How are you displaying them?

There are shared regions which are outputting fine, it's just the regions on the page itself.

<?php if (!defined('PERCH_RUNWAY')) include($_SERVER['DOCUMENT_ROOT'].'/rt_admin/runtime.php'); ?>
<?php perch_layout('global.header', array('page'=>'category-page')); ?>

<?php perch_pages_breadcrumbs(); ?>

<div class="content">
    <div class="wrapper">
        <div class="row">
            <div class="col col-main">
                <?php perch_content('Intro'); ?>
                <?php perch_pages_navigation(array(
                    'from-path' => '*',
                    'levels' => 2,
                    'hide-extensions' => true,
                    'add-trailing-slash' => true,
                    'template' => array('category_menu.html', 'item.html'),
                )); ?>
            </div>
            <div class="col col-aside">
                <?php perch_content('Side Items'); ?>
                <?php perch_layout('global.aside'); ?>
            </div>
        </div>
    </div>
</div>

<?php perch_layout('global.footer'); ?>
Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you have shared regions with the same names?

No. The odd thing is it works fine if I change the page location. It only doesn't work at the specific URL. I assume there must be left over data in the database from when the page was first created and then deleted. I was testing a few things, so something has happened...

Drew McLellan

Drew McLellan 2638 points
Perch Support

That sounds like a likely explanation.