Forum

Thread tagged as: Problem, Blog

Upgraded to Perch 3 - Blog Categories not working

I had an old version of Perch which I have successfully upgraded to Perch 3 and updated all associated apps etc however the categories on my blog are not linking up.

They are blank on the front end and I cannot choose a category when adding a new blog/editing an existing one, however, when I click on 'Categories' I can see them all there?

Let me know which templates you would like to see and I will respond with them.

Chris McGuicken

Chris McGuicken 1 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

What's the name of your category set?

Hi Drew, it is 'blog'

Drew McLellan

Drew McLellan 2638 points
Perch Support

That sounds right then. Can you post your diagnostics?


• Perch: 3.0.4 • Production mode: Production (100) • Installed apps: content (3.0.4), assets (3.0.4), categories (3.0.4), perch_blog (5.5.1), perch_forms (1.9), perch_gallery (2.8.9), perch_members (1.6.1) • DB driver: PDO • DB tables: perch2_blog_authors (3), perch2_blog_categories (18), perch2_blog_comments (0), perch2_blog_index (2039), perch2_blog_posts (92), perch2_blog_posts_to_categories (106), perch2_blog_posts_to_tags (287), perch2_blog_sections (1), perch2_blog_tags (318), perch2_blogs (1), perch2_categories (18), perch2_category_counts (0), perch2_category_sets (1), perch2_content_index (5927), perch2_content_items (1281), perch2_content_regions (125), perch2_forms (2), perch2_forms_responses (1402), perch2_gallery_albums (94), perch2_gallery_image_versions (5880), perch2_gallery_images (981), perch2_members (2), perch2_members_forms (0), perch2_members_member_tags (4), perch2_members_sessions (1), perch2_members_tags (5), perch2_menu_items (12), perch2_navigation (0), perch2_navigation_pages (0), perch2_page_templates (3), perch2_pages (67), perch2_resource_log (2100), perch2_resource_tags (0), perch2_resources (1597), perch2_resources_to_tags (0), perch2_settings (33), perch2_user_passwords (0), perch2_user_privileges (45), perch2_user_role_privileges (26), perch2_user_roles (2), perch2_users (3) • Users: 3 • App runtimes: • <?php • $apps_list = [ • 'perch_blog', • 'perch_forms', • 'perch_gallery', • 'perch_members', ]; • Scheduled tasks for perch_blog: delete_spam_comments (1440 mins) • Editor plug-ins: • H1: 421aa90e079fa326b6494f812ad13e79 • L1: 6be008c8adab3e53c865aad517c96dde • F1: 0c66c2e1f82f9e0b7617b2cb8270f2c7 • headerColour: #ffffff • content_singlePageEdit: 1 • helpURL: • siteURL: / • hideBranding: 1 • content_collapseList: 1 • lang: en-gb • update_2.2.9: done • latest_version: • headerScheme: light • dashboard: 0 • content_hideNonEditableRegions: 0 • perch_blog_post_url: /blog/post.php?s={postSlug} • perch_blog_update: 5.0.1 • perch_gallery_update: 2.7 • update_2.3: done • perch_blog_slug_format: %Y-%m-%d-{postTitle} • perch_blog_akismet_key: • perch_gallery_bucket_mode: single • perch_gallery_bucket: default • perch_members_login_page: /members/index.php?r={returnURL} • perch_blog_comment_notify: 0 • perch_gallery_basicUpload: 0 • logoPath: /ucontrol/resources/bp-logo.png • update_2.3.2: done • on_sale_version: • update_2.4.2: done • content_frontend_edit: 0 • update_2.6.3: done • perch_blog_max_spam_days: 0 • hide_pwd_reset: 0 • update_3.0.4: done • PERCH_DEVELOPMENT: 10 • PERCH_STAGING: 50 • PERCH_PRODUCTION: 100 • PERCH_DB_USERNAME: root • PERCH_DB_SERVER: localhost • PERCH_DB_DATABASE: forever_website • PERCH_DB_PREFIX: perch2_ • PERCH_TZ: Europe/London • PERCH_EMAIL_FROM: steven@designbyconet.com • PERCH_EMAIL_FROM_NAME: Steven Legge • PERCH_LOGINPATH: /4ever/ucontrol • PERCH_PATH: C:\wamp64\www\4ever\ucontrol • PERCH_CORE: C:\wamp64\www\4ever\ucontrol\core • PERCH_RESFILEPATH: C:\wamp64\www\4ever\ucontrol\resources • PERCH_RESPATH: /4ever/ucontrol/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: ed79f7a54b300ef2b1e6 • PERCH_DEBUG: • PERCH_PREVIEW_ARG: preview • PERCH_TEMPLATE_PATH: C:\wamp64\www\4ever\ucontrol\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_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: 5.6.16 • Zend: 2.6.0 • OS: WINNT • SAPI: apache2handler • Safe mode: not detected • MySQL client: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $ • MySQL server: 5.7.9 • Free disk space: 833.07 GB • Extensions: Core, bcmath, calendar, ctype, date, ereg, filter, ftp, hash, iconv, json, mcrypt, SPL, odbc, pcre, Reflection, session, standard, mysqlnd, tokenizer, zip, zlib, libxml, dom, PDO, bz2, SimpleXML, wddx, xml, xmlreader, xmlwriter, apache2handler, openssl, curl, com_dotnet, fileinfo, gd, gettext, gmp, intl, imap, ldap, mbstring, exif, mysql, mysqli, Phar, pdo_mysql, pdo_sqlite, soap, sockets, sqlite3, xmlrpc, xsl, mhash, Zend OPcache, xdebug • GD: Yes • ImageMagick: No • PHP max upload size: 750M • PHP max form post size: 750M • PHP memory limit: 3000M • Total max uploadable file size: 750M • Resource folder writeable: Yes • Session timeout: 24 minutes • Native JSON: Yes • Filter functions: Yes • Transliteration functions: Yes • HTTP_HOST: localhost • HTTP_CONNECTION: keep-alive • HTTP_UPGRADE_INSECURE_REQUESTS: 1 • HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 • HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 • HTTP_REFERER: https://localhost/4ever/ucontrol/core/settings/diagnostics/ • HTTP_ACCEPT_ENCODING: gzip, deflate, sdch, br • HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8 • HTTP_COOKIE: private_content_version=f8cf2692d8a37b9ee4e92068cc6ab274; catAccCookies=1; _ga=GA1.1.1419419705.1478188691; _gid=GA1.1.1543950882.1494946285; __utma=111872281.1419419705.1478188691.1494848418.1494941858.10; __utmz=111872281.1479462991.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); PHPSESSID=204lehrmjlf2o8rgqep0dn9762; cmsa=1 • PATH: C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\nodejs\;C:\WINDOWS\system32\config\systemprofile\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\WINDOWS\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps • SystemRoot: C:\WINDOWS • COMSPEC: C:\WINDOWS\system32\cmd.exe • PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC • WINDIR: C:\WINDOWS • SERVER_SIGNATURE: <address>Apache/2.4.17 (Win64) PHP/5.6.16 Server at localhost Port 80</address> • SERVER_SOFTWARE: Apache/2.4.17 (Win64) PHP/5.6.16 • SERVER_NAME: localhost • SERVER_ADDR: ::1 • SERVER_PORT: 80 • REMOTE_ADDR: ::1 • DOCUMENT_ROOT: C:/wamp64/www • REQUEST_SCHEME: http • CONTEXT_DOCUMENT_ROOT: C:/wamp64/www • SERVER_ADMIN: admin@example.com • SCRIPT_FILENAME: C:/wamp64/www/4ever/ucontrol/core/settings/diagnostics/index.php • REMOTE_PORT: 49720 • GATEWAY_INTERFACE: CGI/1.1 • SERVER_PROTOCOL: HTTP/1.1 • REQUEST_METHOD: GET • QUERY_STRING: extended • REQUEST_URI: /4ever/ucontrol/core/settings/diagnostics/?extended • SCRIPT_NAME: /4ever/ucontrol/core/settings/diagnostics/index.php • PHP_SELF: /4ever/ucontrol/core/settings/diagnostics/index.php • REQUEST_TIME_FLOAT: 1495008169.444 • REQUEST_TIME: 1495008169
Drew McLellan

Drew McLellan 2638 points
Perch Support

When you say "I cannot choose a category when adding a new blog/editing an existing one" what do you mean? Do you get a blank category field?

OK, we solved one problem. When adding a new blog post, I can now select a category, however I cannot get the categories to display in the front end.

I am using this code on /blog/index.php

<?php perch_blog_categories(); ?>
Drew McLellan

Drew McLellan 2638 points
Perch Support

What does debug output?

Debug Message - Perch 3.0.4
[1]SELECT * FROM perch2_pages WHERE pagePath='/blog/index.php' LIMIT 1
[7]SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/blog/index.php' OR regionPage='*' ORDER BY regionPage DESC
[0]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/weight-loss/%' OR idx.indexKey='_category' AND idx.indexValue='blog/weight-loss/'))
[7]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' 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<='2017-05-17 14:35:00' ) GROUP BY itemID, sortval ORDER BY sortval DESC LIMIT 0, 7
[1]SELECT FOUND_ROWS() AS `count`
[33]SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
[7]Using template: /templates/blog/list_in_blog.html
[1]SELECT * FROM perch2_blog_sections ORDER BY sectionTitle ASC
[1]SELECT * FROM perch2_blogs ORDER BY blogTitle ASC
Fetching from cache: perch_blog_date_archive_monthsf2e7d49784704a5b24102a78c349d57c
[5]SELECT year(postDateTime) as year, COUNT(*) AS year_qty FROM perch2_blog_posts WHERE postStatus='Published' AND postDateTime<='2017-05-17 14:35:00' GROUP BY year ORDER BY year DESC
Using template: /templates/blog/months_month_link.html
[3]SELECT DISTINCT year(postDateTime) AS year, month(postDateTime) AS month, CONCAT(year(postDateTime),"-",month(postDateTime),"-01") AS postDateTime, COUNT(*) AS month_qty FROM perch2_blog_posts p WHERE year(postDateTime) = '2017' AND p.postStatus='Published' AND p.postDateTime<='2017-05-17 14:35:00' GROUP BY year, month, postDateTime ORDER BY month DESC
[7]SELECT DISTINCT year(postDateTime) AS year, month(postDateTime) AS month, CONCAT(year(postDateTime),"-",month(postDateTime),"-01") AS postDateTime, COUNT(*) AS month_qty FROM perch2_blog_posts p WHERE year(postDateTime) = '2016' AND p.postStatus='Published' AND p.postDateTime<='2017-05-17 14:35:00' GROUP BY year, month, postDateTime ORDER BY month DESC
[11]SELECT DISTINCT year(postDateTime) AS year, month(postDateTime) AS month, CONCAT(year(postDateTime),"-",month(postDateTime),"-01") AS postDateTime, COUNT(*) AS month_qty FROM perch2_blog_posts p WHERE year(postDateTime) = '2015' AND p.postStatus='Published' AND p.postDateTime<='2017-05-17 14:35:00' GROUP BY year, month, postDateTime ORDER BY month DESC
[11]SELECT DISTINCT year(postDateTime) AS year, month(postDateTime) AS month, CONCAT(year(postDateTime),"-",month(postDateTime),"-01") AS postDateTime, COUNT(*) AS month_qty FROM perch2_blog_posts p WHERE year(postDateTime) = '2014' AND p.postStatus='Published' AND p.postDateTime<='2017-05-17 14:35:00' GROUP BY year, month, postDateTime ORDER BY month DESC
[3]SELECT DISTINCT year(postDateTime) AS year, month(postDateTime) AS month, CONCAT(year(postDateTime),"-",month(postDateTime),"-01") AS postDateTime, COUNT(*) AS month_qty FROM perch2_blog_posts p WHERE year(postDateTime) = '2013' AND p.postStatus='Published' AND p.postDateTime<='2017-05-17 14:35:00' GROUP BY year, month, postDateTime ORDER BY month DESC
[5]Using template: /templates/blog/months_year_link.html
Caching: perch_blog_date_archive_monthsf2e7d49784704a5b24102a78c349d57c
Fetching from cache: perch_blog_categories589c7a634eb12f2ec225cfedc7dc78ae
Cache file not found: perch_blog_categories589c7a634eb12f2ec225cfedc7dc78ae
[1]SELECT setID FROM perch2_category_sets WHERE setSlug='blog' LIMIT 1
[nil]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=1 AND (cc.countType='blog.post' OR cc.countType IS NULL) AND cc.countValue > 0 ORDER BY catTreePosition ASC
Using template: /templates/blog/category_link.html
Fetching from cache: perch_blog_tagse0b2ff59ed95ac2a35516ee8013c2dd2
[109]SELECT t.tagTitle, t.tagSlug, COUNT(p2t.postID) AS qty FROM perch2_blog_tags t, perch2_blog_posts_to_tags p2t, perch2_blog_posts p WHERE p2t.tagID=t.tagID AND p2t.postID=p.postID AND p.postStatus='Published' AND p.postDateTime<='2017-05-17 14:35:00' GROUP BY t.tagID ORDER BY t.tagTitle ASC
[109]Using template: /templates/blog/tag_link.html
Caching: perch_blog_tagse0b2ff59ed95ac2a35516ee8013c2dd2

Drew McLellan

Drew McLellan 2638 points
Perch Support

If you save a post that's in the weight loss category, what happens?

When you did the update, did it run through updating your posts?

When I add a post to the weight loss category, it dissapers from blog/index.php (which is supposed to happen).

The category listings down the right hand side then show as () () () and when I click on them, it goes to https://4everphotos.net/blog/archive.php?cat=

However, I just noticed that when I went into Perch there and tried to edit the 'Blog' Category Set, that the set template and category template are both missing? What files are missing so I can upload them again?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Which version of Blog did you upgrade from? Make sure you've got all the default templates in place.