Forum

Thread tagged as: Problem, Addons, Blog

Blog Categories not working after section change

The function stopped working after I deleted the default blog section called 'blog' (because I wanted new blog posts to be assigned to a different section I created).

Adding section 'blog' back in and assigning blog posts to this section does not work.

I've rebuilt pages several times.

Can someone help me fix this?

The diagnostic report is below


Perch: 3.1.2 Production mode: Production (100) Installed apps: content (3.1.2), assets (3.1.2), categories (3.1.2), perch_blog (5.6.1), perch_forms (1.12) DB driver: PDO DB tables: perch3_blog_authors (1), perch3_blog_comments (0), perch3_blog_index (361), perch3_blog_posts (4), perch3_blog_posts_to_tags (0), perch3_blog_sections (2), perch3_blog_tags (0), perch3_blog_webmention_queue (0), perch3_blogs (1), perch3_categories (2), perch3_category_counts (0), perch3_category_sets (1), perch3_content_index (450), perch3_content_items (85), perch3_content_regions (76), perch3_forms (0), perch3_forms_responses (0), perch3_menu_items (10), perch3_navigation (2), perch3_navigation_pages (13), perch3_page_templates (11), perch3_pages (57), perch3_resource_log (174), perch3_resource_tags (0), perch3_resources (76), perch3_resources_to_tags (0), perch3_settings (13), perch3_user_passwords (1), perch3_user_privileges (42), perch3_user_role_privileges (2), perch3_user_roles (2), perch3_users (1) Users: 1 App runtimes: <?php $apps_list = [ perch_blog, perch_forms ]; Scheduled tasks for perch_blog: delete_spam_comments (1440 mins), publish_posts (1 mins), process_webmentions (1 mins) Editor plug-ins: H1: 421aa90e079fa326b6494f812ad13e79 L1: dabeb78f7e18e1ed8e8819b2b659c557 F1: 3b606135b33e6a102526838f4152a807 headerColour: #ffffff content_singlePageEdit: 1 helpURL: siteURL: / hideBranding: 0 content_collapseList: 1 lang: en-gb installedAt: 3.1.2 update_3.1.2: done latest_version: on_sale_version: 3.1.3 perch_blog_update: 5.6 perch_blog_post_url: /blog/post.php?s={postSlug} PERCH_DEVELOPMENT: 10 PERCH_STAGING: 50 PERCH_PRODUCTION: 100 PERCH_DB_USERNAME: cap_admin PERCH_DB_SERVER: localhost PERCH_DB_DATABASE: admin_capability PERCH_DB_PREFIX: perch3_ PERCH_TZ: UTC PERCH_EMAIL_FROM: jamesh@thirdfloordesign.co.uk PERCH_EMAIL_FROM_NAME: James Holmes PERCH_LOGINPATH: /cms PERCH_PATH: /Users/tfdigital-1/Sites/Capability/cms PERCH_CORE: /Users/tfdigital-1/Sites/Capability/cms/core PERCH_RESFILEPATH: /Users/tfdigital-1/Sites/Capability/cms/resources PERCH_RESPATH: /cms/resources PERCH_HTML5: 1 PERCH_RUNWAY: PERCH_ERROR_MODE: DIE PERCH_DATE_LONG: %d %B %Y PERCH_DATE_SHORT: %d %b %Y PERCH_TIME_SHORT: %H:%M PERCH_TIME_LONG: %H:%M:%S PERCH_RUNWAY_ROUTED: PERCH_STRONG_PASSWORDS: PERCH_ASSET_VERSION: 6738d5d5f5664f7c5e34 PERCH_DEBUG: PERCH_PREVIEW_ARG: preview PERCH_TEMPLATE_PATH: /Users/tfdigital-1/Sites/Capability/cms/templates PERCH_TEMPLATE_FILTERS: PERCH_DEFAULT_DOC: index.php PERCH_DEFAULT_EXT: .php PERCH_PRODUCTION_MODE: 100 PERCH_XHTML_MARKUP: PERCH_RWD: 1 PERCH_HTML_ENTITIES: PERCH_SSL: PERCH_STRIPSLASHES: PERCH_PROGRESSIVE_FLUSH: 1 PERCH_PARANOID: PERCH_FORCE_SECURE_COOKIES: PERCH_DEFAULT_BUCKET: default PERCH_TRANSLATION_ASSIST: PERCH_PASSWORD_MIN_LENGTH: 6 PERCH_MAX_FAILED_LOGINS: 10 PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR PERCH_VERIFY_UPLOADS: PERCH_PRIV_ASSIST: PERCH_CUSTOM_EDITOR_CONFIGS: PERCH_ENABLE_EXIF: 1 PERCH_AUTH_PLUGIN: PERCH_DB_CHARSET: utf8 PERCH_DB_PORT: PERCH_DB_SOCKET: PERCH_APPS_EDITOR_PLUGIN: markitup PERCH_APPS_EDITOR_MARKUP_LANGUAGE: markdown Hosting settings PHP: 7.2.8 Zend: 3.2.0 OS: Darwin SAPI: apache2handler Safe mode: not detected MySQL client: mysqlnd 5.0.12-dev - 20150407 - $Id: 38fea24f2847fa7519001be390c98ae0acafe387 $ MySQL server: 5.7.23 Free disk space: 763.75 GB Extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, SPL, iconv, intl, json, ldap, mbstring, session, standard, mysqlnd, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, mysqli, SimpleXML, soap, sockets, sodium, exif, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, zip, apache2handler, imap, gettext, pgsql, pdo_pgsql GD: Yes ImageMagick: No PHP max upload size: 32M PHP max form post size: 8M PHP memory limit: 128M Total max uploadable file size: 8M Resource folder writeable: Yes Session timeout: 24 minutes Native JSON: Yes Filter functions: Yes Transliteration functions: Yes HTTP_HOST: localhost:8888 HTTP_CONNECTION: keep-alive HTTP_UPGRADE_INSECURE_REQUESTS: 1 HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 HTTP_REFERER: https://localhost:8888/cms/core/settings/diagnostics/ HTTP_ACCEPT_ENCODING: gzip, deflate, br HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.9,nb;q=0.8 HTTP_COOKIE: _ga=GA1.1.931960458.1535125037; hubspotutk=9746f66b0c2d02ffe816a32ddcc5cf03; viewed_cookie_policy=yes; __hstc=181257784.9746f66b0c2d02ffe816a32ddcc5cf03.1535125037938.1535458356230.1535637216616.3; _gcl_au=1.1.1047913808.1537258478; cmsa=1; PHPSESSID=t4cpop1lu6fhrlp9djaln33qdb PATH: /usr/bin:/bin:/usr/sbin:/sbin SERVER_SOFTWARE: Apache/2.2.34 (Unix) mod_wsgi/3.5 Python/2.7.13 PHP/7.2.8 mod_ssl/2.2.34 OpenSSL/1.0.2o DAV/2 mod_fastcgi/mod_fastcgi-SNAP-0910052141 mod_perl/2.0.9 Perl/v5.24.0 SERVER_NAME: localhost SERVER_ADDR: ::1 SERVER_PORT: 8888 REMOTE_ADDR: ::1 DOCUMENT_ROOT: /Users/tfdigital-1/Sites/Capability SERVER_ADMIN: you@example.com SCRIPT_FILENAME: /Users/tfdigital-1/Sites/Capability/cms/core/settings/diagnostics/index.php REMOTE_PORT: 56915 GATEWAY_INTERFACE: CGI/1.1 SERVER_PROTOCOL: HTTP/1.1 REQUEST_METHOD: GET QUERY_STRING: extended REQUEST_URI: /cms/core/settings/diagnostics/?extended SCRIPT_NAME: /cms/core/settings/diagnostics/index.php PHP_SELF: /cms/core/settings/diagnostics/index.php REQUEST_TIME_FLOAT: 1542189522.003 REQUEST_TIME: 1542189522 argc: 1
Neal Hanson

Neal Hanson 0 points

  • 2 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

The function stopped working

Can you show us which function you're using?

<?php
    perch_blog_categories(array(
        'template' => 'category_tabs.html',
    ));
?>    

category_tabs.html is saved in cms/addons/apps/perch_blog/templates/blog/category_tabs.html

hi Drew. Was what I sent any help?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you still have a category set with the slug blog ?

Hi Drew, Yes.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you turn on debug for the page and let me know what it outputs?

How do you do that?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Here is the report:

The template file in question is category_tabs.html saved in cms/addons/apps/perch_blog/templates/blog/

Debug Message - Perch 3.1.2
[31] SELECT DISTINCT settingID, settingValue FROM perch3_settings WHERE userID=0
[7] SELECT regionKey, regionHTML FROM perch3_content_regions WHERE regionPage='/case-studies/index.php' OR regionPage='*' ORDER BY regionPage DESC
[1] SELECT * FROM perch3_pages WHERE pagePath='/case-studies/index.php' LIMIT 1
[1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch3_content_regions WHERE regionKey='Meta Tags' AND (regionPage='/case-studies/index.php' OR regionPage='*')
[1] SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch3_content_index idx JOIN perch3_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch3_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=114 AND idx.itemRev=1)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval, regionID ORDER BY sortval ASC
Using template: /templates/content/foundation/meta-tags.html
Using template: /templates/pages/attributes/default.html
Using sub-template: /templates/pages/attributes/seo.html
[1] SELECT groupID FROM perch3_navigation WHERE groupSlug='header' LIMIT 1
[8] SELECT np.pageID, np.pageParentID, p.pagePath, p.pageTitle, p.pageNavText, p.pageNew, p.pageOrder, np.pageDepth, p.pageSortPath, np.pageTreePosition, p.pageAccessTags, p.pageAttributes FROM perch3_navigation_pages np, perch3_pages p WHERE p.pageID=np.pageID AND np.groupID=2 AND p.pageNew=0 AND np.pageDepth >=0 AND np.pageDepth<=1 ORDER BY np.pageTreePosition ASC
[0] SELECT np.pageTreePosition FROM perch3_pages p, perch3_navigation_pages np WHERE np.pageID=p.pageID AND np.groupID=2 AND p.pagePath='/case-studies/index.php' LIMIT 1
[8] Using template: /templates/navigation/foundation/menu.html
[1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch3_content_regions WHERE regionKey='Header' AND (regionPage='/case-studies/index.php' OR regionPage='*')
[1] SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch3_content_index idx JOIN perch3_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch3_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=76 AND idx.itemRev=2)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval, regionID ORDER BY sortval ASC
[1] Using template: /templates/content/foundation/header.html
Using sub-template: /templates/content/foundation/primary-nav.html
[1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch3_content_regions WHERE regionKey='Page Intro' AND (regionPage='/case-studies/index.php' OR regionPage='*')
[1] SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch3_content_index idx JOIN perch3_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch3_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=56 AND idx.itemRev=2)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval, regionID ORDER BY sortval ASC
[1] Using template: /templates/content/foundation/page-intro.html
Using template: /templates/search/category-search.html
Fetching from cache: perch_blog_categories56a0e96032a1619149ad2f2fe63ca4ee
Cache file not found: perch_blog_categories56a0e96032a1619149ad2f2fe63ca4ee
[1] SELECT setID FROM perch3_category_sets WHERE setSlug='blog' LIMIT 1
[nil] SELECT main.* , COALESCE(cc.countValue,0) AS `count.blog.post` FROM perch3_categories main LEFT OUTER JOIN perch3_category_counts cc ON cc.catID=main.catID WHERE 1=1 AND setID=1 AND (cc.countType='blog.post' OR cc.countType IS NULL) AND cc.countValue > 0 ORDER BY catTreePosition ASC
Using template: /addons/apps/perch_blog/templates/blog/category_tabs.html
[1] SELECT SQL_CALC_FOUND_ROWS DISTINCT tbl.* FROM ( SELECT idx.itemID, main.*, idx2.indexValue as sortval FROM perch3_blog_index idx JOIN perch3_blog_posts main ON idx.itemID=main.postID AND idx.itemKey='postID' JOIN perch3_blog_index idx2 ON idx.itemID=idx2.itemID AND idx.itemKey='postID' AND idx2.indexKey='postDateTime' WHERE 1=1 AND idx.itemID=idx2.itemID AND idx.itemKey=idx2.itemKey GROUP BY idx.itemID, idx2.indexValue, postID ) as tbl WHERE (postStatus='Published' AND postDateTime<='2018-11-27 11:00:00' ) GROUP BY itemID, sortval ORDER BY sortval DESC LIMIT 0, 1
[1] SELECT FOUND_ROWS() AS `count`
Fetching from cache: perch_blog_post_categoriesc3d9475b4d0f98fd67c62621084c6c62
Using template: /addons/apps/perch_blog/templates/blog/post-listing.html
[1] Using template: /templates/pagination/page-links.html
[2] SELECT * FROM perch3_blog_sections ORDER BY sectionTitle ASC
[1] SELECT * FROM perch3_blogs ORDER BY blogTitle ASC
[1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch3_content_regions WHERE regionKey='CTA Banner' AND (regionPage='/case-studies/index.php' OR regionPage='*')
[1] SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch3_content_index idx JOIN perch3_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch3_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=18 AND idx.itemRev=2)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval, regionID ORDER BY sortval ASC
[1] Using template: /templates/content/foundation/cta.html
[1] SELECT groupID FROM perch3_navigation WHERE groupSlug='footer' LIMIT 1
[4] SELECT np.pageID, np.pageParentID, p.pagePath, p.pageTitle, p.pageNavText, p.pageNew, p.pageOrder, np.pageDepth, p.pageSortPath, np.pageTreePosition, p.pageAccessTags, p.pageAttributes FROM perch3_navigation_pages np, perch3_pages p WHERE p.pageID=np.pageID AND np.groupID=1 AND p.pageNew=0 AND np.pageDepth >=0 AND np.pageDepth<=1 ORDER BY np.pageTreePosition ASC
[0] SELECT np.pageTreePosition FROM perch3_pages p, perch3_navigation_pages np WHERE np.pageID=p.pageID AND np.groupID=1 AND p.pagePath='/case-studies/index.php' LIMIT 1
[4] Using template: /templates/navigation/foundation/menu.html
[1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch3_content_regions WHERE regionKey='Social Icons' AND (regionPage='/case-studies/index.php' OR regionPage='*')
[1] SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch3_content_index idx JOIN perch3_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch3_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=69 AND idx.itemRev=2)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval, regionID ORDER BY sortval ASC
[1] Using template: /templates/content/foundation/social-menu.html
Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you reassigned the posts to the new section since creating it?

yes. I am sure I did that. To be honest what I want is for posts to be assigned to section "case studies" by default