Forum

Thread tagged as: Configuration

Blog and Sections Error

In Runway I was going to use sections to create separate English and Spanish blogs. Then I changed my mind and set up an English and Spanish blog. When I deleted the two Sections I'd created previously I got this error.

Fatal error: Call to a member function id() on a non-object in /Users/andyclark/Sites/conil/public/perch/addons/apps/perch_blog/modes/section.list.pre.php on line 25

So I updated Perch to the latest version, logged in and now I get the error below when I try to go to Apps / Blog?

Fatal error: Call to a member function setSlug() on a non-object in /Users/andyclark/Sites/conil/public/perch/addons/apps/perch_blog/modes/list.pre.php on line 37

I suspect the two are linked. The existing text blog posts I have created are still displaying.

debug message

Time    Δ   Debug Message
0.537   0   [1] SELECT * FROM perch2_pages WHERE pagePath='/perch/core/runway/start.php' LIMIT 1
0.6572  0.1202  [135] SELECT p.pagePath, pr.routePattern, pr.routeRegExp, p.pageTemplate FROM perch2_pages p LEFT JOIN perch2_page_routes pr ON p.pageID=pr.pageID ORDER BY pr.routeOrder ASC, p.pagePath ASC
0.6589  0.0017  Matched page: /en/blog, so not using routes.
0.6591  0.0001  Using master page: /templates/pages/en/blog/index.php
0.6876  0.0285  [1] SELECT * FROM perch2_pages WHERE pagePath='/en/blog' LIMIT 1
0.6895  0.0019  Using template: /templates/pages/attributes/default.html
0.7165  0.027   Using sub-template: /templates/pages/attributes/seo.html
0.7245  0.008   Using sub-template: /templates/pages/attributes/facebook.html
0.7349  0.0104  Using sub-template: /templates/pages/attributes/twitter.html
0.7496  0.0148  Using template: /templates/search/search-form.html
0.8341  0.0844  [1] SELECT DISTINCT idx.itemID FROM perch2_blog_index idx JOIN perch2_blog_posts main ON idx.itemID=main.postID AND idx.itemKey='postID' AND (idx.indexKey='_category' AND idx.indexValue LIKE 'blog/attractions/%' OR idx.indexKey='_category' AND idx.indexValue='blog/attractions/')
0.845   0.0109  [1] SELECT blogID FROM perch2_blogs WHERE blogSlug='english' LIMIT 1
0.8454  0.0004  [1] SELECT SQL_CALC_FOUND_ROWS DISTINCT tbl.* FROM ( SELECT idx.itemID, main.*, idx2.indexValue as sortval FROM perch2_blog_index idx JOIN perch2_blog_posts main ON idx.itemID=main.postID AND idx.itemKey='postID' JOIN perch2_blog_index idx2 ON idx.itemID=idx2.itemID AND idx.itemKey='postID' AND idx2.indexKey='postDateTime' AND idx.itemID IN ('7') WHERE 1=1 AND idx.itemID=idx2.itemID AND idx.itemKey=idx2.itemKey GROUP BY idx.itemID, idx2.indexValue, postID ) as tbl WHERE ( blogID=3 AND postStatus='Published' AND postDateTime<='2016-04-01 17:55:00' ) GROUP BY itemID, sortval ORDER BY sortval DESC LIMIT 0, 10
0.9454  0.1 [1] SELECT FOUND_ROWS() AS `count`
1.003   0.0576  [60] SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
1.0133  0.0103  [1] Using template: /templates/blog/post_in_list.html
1.0311  0.0178  [1] SELECT * FROM perch2_blog_sections ORDER BY sectionTitle ASC
1.0324  0.0012  [2] SELECT * FROM perch2_blogs ORDER BY blogTitle ASC
1.0553  0.0229  [1] SELECT setID FROM perch2_category_sets WHERE setSlug='blog' LIMIT 1
1.0557  0.0003  [1] SELECT main.* , COALESCE(cc.countValue,0) AS `count.blog.post` FROM perch2_categories main LEFT OUTER JOIN perch2_category_counts cc ON cc.catID=main.catID WHERE 1=1 AND setID=21 AND (cc.countType='blog.post' OR cc.countType IS NULL) AND cc.countValue > 0 ORDER BY catTreePosition ASC
1.0567  0.0011  [1] Using template: /templates/blog/category_link.html
1.0911  0.0344  [23] SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/en/blog' OR regionPage='*' ORDER BY regionPage DESC

Andy Clark

Andy Clark 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Did you delete the default blog?

Yes, I probably did. I started off using sections for two languages. Changed my mind then I created a Spanish blog and an English blog.

Then cleaned everything else up by deleting the existing sections and the renamed default blog.

Drew McLellan

Drew McLellan 2638 points
Perch Support

There's a bug in the current version if you delete the default blog. It's fixed in dev so will be in the next update.

Thanks, I'm glad my recklessness has helped to highlight a bug.