Forum

Thread tagged as: Problem

Deleted regions not re-appearing again

I have a single page website which had around 7/8 editable Perch regions on it. The client made a mess of their Perch admin page and now there are no regions available! (Although the site still is still strangely displaying perch content). The message I get is: No content yet? Make sure you have added some editable regions into your page, and then visited that page in your browser. Once you have, the regions should show up here.

I've refreshed/deleted browser cache; no joy, I've re-uploaded my offline copy of /index.php and hoped Perch would re-pickup available regions after page refresh; no joy, I've re-uploaded all the perch content templates again; no joy. I've updated Perch; no joy. I've tried republishing pages; no joy.

What am I doing wrong?

Summary information
Perch: 3.1.1, PHP: 7.1.16, MySQL: 5.6.39, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (3.1.1), assets (3.1.1), categories (3.1.1)
App runtimes: <?php $apps_list = [ ];
PERCH_LOGINPATH: /perch
PERCH_PATH: /var/www/vhosts/87/908905/webspace/httpdocs/bespokebuild.ie/perch
PERCH_CORE: /var/www/vhosts/87/908905/webspace/httpdocs/bespokebuild.ie/perch/core
PERCH_RESFILEPATH: /var/www/vhosts/87/908905/webspace/httpdocs/bespokebuild.ie/perch/resources
Image manipulation: GD
PHP limits: Max upload 32M, Max POST 32M, Memory: 256M, Total max file upload: 32M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
HTTP_HOST: www.bespokebuild.ie
DOCUMENT_ROOT: /var/www/vhosts/87/908905/webspace/httpdocs/bespokebuild.ie
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Cormac Kerrigan

Cormac Kerrigan 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Is Ctrl-E to Edit enabled?

Hi Drew, it wasn't so I enabled it, saved and checked again; still no joy.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you tried invoking it from the page?

Drew McLellan said:

Have you tried invoking it from the page?

I don't know what that means?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Once Ctrl-E is enabled, go to the page on your website with the content and press Ctrl-E.

Hi Drew, I've tried that and it hasn't made any difference (I'm on a Mac btw, so I tried both Ctrl-E & Cmd-E) It's a single page simple website. As a test, I decided to copy the /index.php and rename /index2.php and upload this to server to se if this regions get pulled in for this page. When I did this; It picks up the /index2.php page on Perch but has not regions underneath it. It also picks up 3 other pages (not mine!), that presumably this customer tried to create using the 'Add Page' button on the top righthand side of the screen, even though I hadn't enabled the pages app template for this site. When I try and delete any of these 3 pages, Perch simply kicks me out to login screen. Should I reinstall Perch completely here? I've turned on Debug, but nothing jumps out;

Debug Message - Perch 3.1.1
[1] SELECT u.*, r.* FROM perch3_users u, perch3_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='93d5c8bb7b789c5856fa435634be7244' LIMIT 1
UPDATE perch3_users SET userHash='b0ce7064746b2bfeb81946741ed5c032' WHERE userID='1'
[22] SELECT settingID, settingValue, userID FROM perch3_settings WHERE userID=1 OR userID=0 ORDER BY userID ASC
[6] SELECT itemValue FROM perch3_menu_items WHERE itemType='app'
[1] SELECT * FROM perch3_pages WHERE pageID=0 LIMIT 1
[nil] SELECT SQL_CALC_FOUND_ROWS DISTINCT * FROM perch3_content_regions WHERE pageID=0 AND regionPage!='*' ORDER BY regionOrder ASC LIMIT 0, 100
[0] SELECT FOUND_ROWS() AS `count`
[1] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 0, 1
[1] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=1 ORDER BY mi.itemOrder ASC
[1] SELECT itemTitle FROM perch3_menu_items WHERE itemType='app' AND itemValue='content' LIMIT 1
[1] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 1, 10
[2] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=2 ORDER BY mi.itemOrder ASC
Drew McLellan

Drew McLellan 2638 points
Perch Support

How are your regions declared in the page?

They are declared within the individual editable div areas.

<?php perch_content('Gallery'); ?> <?php perch_content('Testimonials'); ?>

This website was working perfect as was, so I doubt it's the regions code that's the root cause. It's strange that the gallery images (which are obviously declared through Perch) are still holding on the website, almost like they are in a cached state.

Drew McLellan

Drew McLellan 2638 points
Perch Support

If you turn on debug on the front-facing page, what does it output?

The front facing page (/index.php) is not being picked up on Perch at all as a page. The test identical duplicate of this page (/index2.php) is reporting the below:

Debug Message - Perch 3.1.1
[1] SELECT u.*, r.* FROM perch3_users u, perch3_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='2743ba53465b54341ee2ea4f35b65914' LIMIT 1
UPDATE perch3_users SET userHash='d8f062f02b9c0069e56737025fe1b232' WHERE userID='1'
[22] SELECT settingID, settingValue, userID FROM perch3_settings WHERE userID=1 OR userID=0 ORDER BY userID ASC
[6] SELECT itemValue FROM perch3_menu_items WHERE itemType='app'
[1] SELECT * FROM perch3_pages WHERE pageID=0 LIMIT 1
[nil] SELECT SQL_CALC_FOUND_ROWS DISTINCT * FROM perch3_content_regions WHERE pageID=0 AND regionPage!='*' ORDER BY regionOrder ASC LIMIT 0, 100
[0] SELECT FOUND_ROWS() AS `count`
[1] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 0, 1
[1] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=1 ORDER BY mi.itemOrder ASC
[1] SELECT itemTitle FROM perch3_menu_items WHERE itemType='app' AND itemValue='content' LIMIT 1
[1] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 1, 10
[2] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=2 ORDER BY mi.itemOrder ASC
File: /core/apps/content/modes/page.post.php
Queries: 13
Memory: 1.5669
Drew McLellan

Drew McLellan 2638 points
Perch Support

The front facing page (/index.php) is not being picked up on Perch at all as a page.

But you can add debug to see what it outputs, right?

Drew McLellan said:

The front facing page (/index.php) is not being picked up on Perch at all as a page.

But you can add debug to see what it outputs, right?

No, the debug you see above is from /index2.php. This is the exact same file, just renamed. It is getting picked up in Perch (along with 3 other pages). It's not picking it's regions up though and I cannot delete any of these pages.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Duplicating the file doesn't help with a data issue. I need to see the debug output from /index.php.

Hi Drew. I cannot create the /index.php on Perch, so I cannot provide the debug. I have the file (/index.php) offline and if I copy over a new copy of this file to the server and refresh the website, it doesn't get picked up? If I copy/paste/rename this file to be /index2.php it does get picked up but is not working right either?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Does /index.php no longer exist as the homepage of your website? I know you can't see it in the control panel, but that isn't necessary to add the debug code to the file, and will help us get to that point.

Anything you do with index2.php is no help at this stage, as we're not trying to debug a working page, we're trying specifically to debug index.php.

Hi Drew. It would appear that the original database became corrupted somehow... possibly because they had admin rights and tried adding a page that they didn't have the ability to do. I have since revoked this and given them Editor rights. Truth be told, I have no idea what they did or how it ended up behaving/corrupting like this. Anyway, I decided to create a new database on the server and update the config file, re-setup Perch and rebuild the page. Fixed now (the hard way!) Thanks.