Forum

Thread tagged as: Problem, Error, Blog

Help troubleshooting Blog Post title URL

Hello,

I'm using Perch Runway 2.8.32 and Blog 5.0. Attached summary diagnostics for both of my environments at end of post.

This is my blog post Title field in my post.html template:

<perch:blog id="postTitle" type="text" label="Title"  size="xl autowidth" required="true" order="1" />

This is my blog post Title field in my post_in_list.html template:

<a href="/news/<perch:blog id="postSlug" />" rel="bookmark" class="entry-title"><perch:blog id="postTitle" /></a>

My problem is that in my live server environment, I'm getting some results that I don't get in my development environment and I'm not sure where to begin troubleshooting the issue.

There is a post with a title of "Our Academy is a Level 1+ School!".

In my development environment the output URL from my post_in_list.html template is:

https://goodestemacademy.dev/news/2016-10-07-our-academy-is-a-level-1-school

and this works and directs me to the post.

In my live environment the output URL includes the + character and the link produces a "page cannot be found" result:

https://goodestemacademy.org/news/2016-10-07-our-academy-is-a-level-1+-school

I've checked all my routes between environments and they are identical and sorted in the same order.

Also my routing token in both environments is:

'blogslug' => '[1-2][0-9]{3}\-[0-9]{2}\-[0-3][0-9]-[a-z0-9\-]+',

Any guidance or advice, to at least know where to begin troubleshooting is appreciated.

Here is my development perch diagnostics:

Perch Runway: 2.8.32, PHP: 5.6.24, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $, with PDO
Server OS: WINNT, apache2handler
Installed apps: content (2.8.32), assets (2.8.32), categories (2.8.32), jw_activity_log (1.0.1), collection_3 (2.8.32), collection_4 (2.8.32), collection_5 (2.8.32), perch_blog (5.0), collection_1 (2.8.32)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', );
PERCH_LOGINPATH: /cms
PERCH_PATH: C:\xampp\htdocs\goodestemacademy\cms
PERCH_CORE: C:\xampp\htdocs\goodestemacademy\cms\core
PERCH_RESFILEPATH: C:\xampp\htdocs\goodestemacademy\cms\resources
Image manipulation: GD
PHP limits: Max upload 50M, Max POST 50M, Memory: 128M, Total max file upload: 50M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
HTTP_HOST: goodestemacademy.dev
DOCUMENT_ROOT: C:/xampp/htdocs/goodestemacademy
REQUEST_URI: /cms/core/settings/diagnostics/
SCRIPT_NAME: /cms/core/settings/diagnostics/index.php

And here is my live perch diagnostics:

Perch Runway: 2.8.32, PHP: 5.6.27, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (2.8.32), assets (2.8.32), categories (2.8.32), jw_activity_log (1.0.1), collection_3 (2.8.32), collection_4 (2.8.32), perch_blog (5.0), collection_1 (2.8.32)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', );
PERCH_LOGINPATH: /cms
PERCH_PATH: /home1/ichernan/public_html/goodestemacademy/cms
PERCH_CORE: /home1/ichernan/public_html/goodestemacademy/cms/core
PERCH_RESFILEPATH: /home1/ichernan/public_html/goodestemacademy/cms/resources
Image manipulation: GD Imagick
PHP limits: Max upload 50M, Max POST 50M, Memory: 128M, Total max file upload: 50M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
DOCUMENT_ROOT: /home1/ichernan/public_html/goodestemacademy
HTTP_HOST: goodestemacademy.org
REQUEST_URI: /cms/core/settings/diagnostics/
SCRIPT_NAME: /cms/core/settings/diagnostics/index.php
Joshua Rodriguez

Joshua Rodriguez 2 points

  • 4 years ago

Just a quick update:

I tested the same post title with two other websites I have on the same web hosting account. These two sites are built with Perch, not Runway, but I see the same results.

I know its not an issue isolated to Perch or Runway. It's an environment issue, but not sure where to begin troubleshooting. Please advise.

Thank you!

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Does this happen after you have imported the data from dev to live or is it happening on creating a new post on the server?

Hi Rachel,

My client created the post on the live server and that's when I noticed the issue. So no import from dev to live, except for when I uploaded the full website months ago.

I tried to reproduce the issue on my local development server, but everything seems to work fine there. So I checked and uploaded all my templates again, double-checked that my routes and tokens were the same between environments.

I tried adding other characters, but only the "+" character seems to stay on my live server blog posts. I also tried adding a "+" to other post entry titles and they are also not being removed on my live server.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you post your extended diagnostics for the live server?

Hi Drew,

Here's my extended report for the live server:

Perch Runway: 2.8.32
Production mode: Production (100)
Installed apps: content (2.8.32), assets (2.8.32), categories (2.8.32), jw_activity_log (1.0.1), collection_3 (2.8.32), collection_4 (2.8.32), perch_blog (5.0), collection_1 (2.8.32)
DB driver: PDO
DB tables: seg_backup_plans (0), seg_backup_resources (0), seg_backup_runs (0), seg_blog_authors (6), seg_blog_comments (0), seg_blog_index (1239), seg_blog_posts (45), seg_blog_posts_to_tags (0), seg_blog_sections (1), seg_blog_tags (0), seg_blogs (1), seg_categories (61), seg_category_counts (7), seg_category_sets (7), seg_collection_index (18481), seg_collection_items (1090), seg_collection_revisions (241), seg_collections (3), seg_content_index (5037), seg_content_items (1418), seg_content_regions (784), seg_jw_activity_log_actions (491), seg_navigation (3), seg_navigation_pages (27), seg_page_routes (8), seg_page_templates (41), seg_pages (226), seg_resource_log (3065), seg_resource_tags (0), seg_resources (788), seg_resources_to_tags (0), seg_settings (37), seg_user_passwords (35), seg_user_privileges (37), seg_user_role_privileges (360), seg_user_roles (55), seg_users (56)
Users: 56
App runtimes:
<?php
    $apps_list = array(
        'content', 
        'categories',
        'perch_blog',
    );
Scheduled tasks for jw_activity_log: prune_actions_log (1440 mins)
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Editor plug-ins: markitup, redactor
H1: 64d00f072d321e6a07dd0c268c126c79
L1: dd016e185357f9839780f44f4775da15
F1: 2edba60ed1f613d6dd804feb202456a2
headerColour: #b9131a
content_singlePageEdit: 1
siteURL: /
hideBranding: 1
content_collapseList: 0
lang: en-gb
update_2.8.24: done
logoPath: /cms/resources/Goode_PrimaryLogoColor_RGB_.png
headerScheme: dark
update_runway_2.8.24: done
latest_version: 2.8.15
on_sale_version: 2.8.32
content_hideNonEditableRegions: 1
content_frontend_edit: 1
dashboard: 0
hide_pwd_reset: 1
update_runway_2.8.25: done
update_runway_2.8.26: done
perch_blog_update: 5.0.1
perch_blog_post_url: /news/post?={postSlug}
update_runway_2.8.27: done
perch_blog_site_name: Goode STEM Academy
perch_blog_slug_format: %Y-%m-%d-{postTitle}
perch_blog_akismet_key:
perch_blog_max_spam_days: 0
perch_blog_comment_notify: 0
update_runway_2.8.28: done
update_runway_2.8.29: done
update_runway_2.8.31: done
helpURL: /support
jw_activity_log_prune_time: 365
update_runway_2.8.32: done
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_SITEPATH: \goodestemacademy\cms\setup\runway\modes
PERCH_SCHEDULE_SECRET: 7FbcMvUNis7ooooQ
PERCH_DB_USERNAME: ichernan_admin84
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: ichernan_segacms
PERCH_DB_PREFIX: seg_
PERCH_EMAIL_FROM: contact@goodestemacademy.org
PERCH_EMAIL_FROM_NAME: Sarah E. Goode STEM Academy
PERCH_LOGINPATH: /cms
PERCH_PATH: /home1/ichernan/public_html/goodestemacademy/cms
PERCH_CORE: /home1/ichernan/public_html/goodestemacademy/cms/core
PERCH_RESFILEPATH: /home1/ichernan/public_html/goodestemacademy/cms/resources
PERCH_RESPATH: /cms/resources
PERCH_HTML5: 1
PERCH_TZ: America/Chicago
PERCH_YOUTUBE_API_KEY: AIzaSyDlTEo4CIv4Yycn3c8uJvNNNtU7WUh776Y
PERCH_CLEAN_RESOURCES: 1
PERCH_PARANOID: 1
PERCH_MAX_FAILED_LOGINS: 10
PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR
PERCH_STRONG_PASSWORDS: 1
PERCH_PASSWORD_MIN_LENGTH: 8
PERCH_VERIFY_UPLOADS: 1
PERCH_RUNWAY: 1
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_DEBUG:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /home1/ichernan/public_html/goodestemacademy/cms/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_FORCE_SECURE_COOKIES: 1
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_SESSION_TIMEOUT_MINS: 20
PERCH_APPS_EDITOR_PLUGIN: markitup
PERCH_APPS_EDITOR_MARKUP_LANGUAGE: textile
HOSTING SETTINGS

PHP: 5.6.27
Zend: 2.6.0
OS: Linux
SAPI: cgi-fcgi
Safe mode: not detected
MySQL client: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $
MySQL server: 5.5.51-38.2-log
Free disk space: 219.49 GB
Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dba, dom, enchant, hash, fileinfo, filter, ftp, gd, gettext, SPL, iconv, session, intl, json, mbstring, mcrypt, standard, mysql, mysqli, odbc, mysqlnd, PDO, pdo_dblib, PDO_ODBC, Phar, posix, pspell, Reflection, imap, SimpleXML, snmp, soap, sockets, exif, tidy, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, cgi-fcgi, imagick, pdo_mysql, pdo_sqlite, pdo_pgsql, magickwand, mhash, Zend Guard Loader, Zend OPcache
GD: Yes
ImageMagick: Yes
PHP max upload size: 50M
PHP max form post size: 50M
PHP memory limit: 128M
Total max uploadable file size: 50M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: Yes
DOCUMENT_ROOT: /home1/ichernan/public_html/goodestemacademy
GATEWAY_INTERFACE: CGI/1.1
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8
HTTP_CONNECTION: close
HTTP_COOKIE: _gat=1; _ga=GA1.2.2089363451.1477147449; PHPSESSID=1gdcr5a7trjm70u1foptc11k64
HTTP_HOST: goodestemacademy.org
HTTP_REFERER: https://goodestemacademy.org/cms/core/settings/diagnostics/
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36
HTTP_X_HTTP_PROTO: HTTP/1.1
HTTP_X_REAL_IP: 73.22.72.164
MAGICK_THREAD_LIMIT: 1
PATH: /bin:/usr/bin
QUERY_STRING: extended
REDIRECT_STATUS: 200
REMOTE_ADDR: 73.22.72.164
REMOTE_PORT: 45783
REQUEST_METHOD: GET
REQUEST_URI: /cms/core/settings/diagnostics/?extended
SCRIPT_FILENAME: /home1/ichernan/public_html/goodestemacademy/cms/core/settings/diagnostics/index.php
SCRIPT_NAME: /cms/core/settings/diagnostics/index.php
SERVER_ADDR: 66.147.244.118
SERVER_ADMIN: webmaster@goodestemacademy-org.ichernandez.org
SERVER_NAME: goodestemacademy.org
SERVER_PORT: 80
SERVER_PROTOCOL: HTTP/1.1
SERVER_SIGNATURE: <address>Apache Server at goodestemacademy.org Port 80</address>
SERVER_SOFTWARE: Apache
UNIQUE_ID: WAzDEUKT9HYAADATQN8AAACS
PHPRC: /home1/ichernan/public_html/:/usr/php/56/etc/
PHP_SELF: /cms/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1477231377.8538
REQUEST_TIME: 1477231377
Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, it looks like you have transliteration available.

Can you give an example of the input and the output you're getting?

Not sure if I understand if this is what you're asking for, but please let me know.

So on my live server, for testing I created a blog post in the admin panel that includes some common characters:

Naviance! (for CPS) + Pre-Registration. Your recommendations?

and the post title above displays just fine.

However, the URL output is still including the + character and I get a 'page cannot be found' error if I click on the link:

https://goodestemacademy.org/news/2016-09-30-naviance-for-cps-+-pre-registration-your-recommendations

and if I remove the + character, the link works and takes me to my blog post.

For the URL of the post, I'm using postSlug like this in my template:

<a href="/news/<perch:blog id="postSlug" />" rel="bookmark" class="entry-title"><perch:blog id="postTitle" /></a>
Drew McLellan

Drew McLellan 2638 points
Perch Support

I think it's probably because the default slug token doesn't include + as it has a special meaning in URLs.

If you're doing to use a plus in your URLs you might need to specify a custom token to handle it.

Hello,

I have not specified a custom token yet. I understand the default slug token doesn't include +, but in that case I don't understand why upon saving is the + symbol not being removed from the URL then? I followed the documentation for setting up my blog in Runway (https://docs.grabaperch.com/addons/blog/runway/config/) and I'm begining to wonder if there may be something else wrong.

I have another blog post that is displaying a "Page not Found" error message when I select the blog post from my list of posts. Same client, nothing has changed as far as configuration and setup. I checked the error log and the last entry dates back to Oct. 23rd. This time the title of the post is simply ​Parent Informational Meeting for 2018 Spring Break Trip and the output URL appears to be fine: https://goodestemacademy.org/news/2016-11-07-parent-informational-meeting-for-2018-spring-break-trip.

The post is on the live website if you have a moment to take a look. Other posts are working fine, but this one produces a "Page not Found" error for some reason.

Please help!

Drew McLellan

Drew McLellan 2638 points
Perch Support

You have a zero-width space character before the P of Parent.

Drew,

Wow, if you don't mind me asking, how were you able to see this character?

I cleared out the title and inserted just 'title', then manually retyped the original title of the post and it's working fine now. My guess is that my client probably copy and pasted the code from a Word document??

Would any perch tag attributes be helpful to avoid this in the future? Like the escape, urlencode, or urlify tag attributes?

If I added any of these attributes to my tag though, would that cause any issues with my default routing token since I assume these attributes would introduce other characters?

'blogslug' => '[1-2][0-9]{3}\-[0-9]{2}\-[0-3][0-9]-[a-z0-9\-]+',
Drew McLellan

Drew McLellan 2638 points
Perch Support

Wow, if you don't mind me asking, how were you able to see this character?

I have super powers.

Actually, you can see it encoded into an HTML entity in the source.

My guess is that my client probably copy and pasted the code from a Word document??

That would be my assumption. It's very hard to strip out junk that Word inserts without accidentally damaging good content in the process. In the 15 or so years I've been building content management systems, the only reliable way I've found to avoid it is to never copy and paste from Word.

After seeing the previews to Perch 3, I might actually believe the super powers.

Regarding copying from Word, I'll make sure to point this out to my client. Thanks for your help.

I haven't closed this thread though because while I understand you suggested I would need to specify a custom token, I'm not sure what my custom token should be? Also, how would I reference my customized token versus the default token? Would I simply need to change my Blog post page path value under Settings...or does it go beyond that to my templates, etc.?

Drew McLellan

Drew McLellan 2638 points
Perch Support

I'm not sure I follow what you're asking about the custom token.

I have this as my default and only routing token for my blog posts in my runway.php file:

'blogslug' => '[1-2][0-9]{3}\-[0-9]{2}\-[0-3][0-9]-[a-z0-9\-]+'

The issue I had was that my client added a post containing a + character in the title: (e.g. Our Academy is a Level 1+ School!)

In my local development environment the + character is removed and the link (e.g. 2016-10-07-our-academy-is-a-level-1-school) works fine, but in my live environment the '+' character is not removed and the link (e.g. 2016-10-07-our-academy-is-a-level-1+-school) produces a "Page Cannot be Found" error.

Earlier in the thread you suggested:

I think it's probably because the default slug token doesn't include + as it has a special meaning in URLs. If you're going to use a plus in your URLs you might need to specify a custom token to handle it.

So that's where I'm a bit lost. I see 2 options: modify my default token or leave the default as is and add a custom token.

If I modify the default token, how would I need to modify my blogslug routing token to include the + character?

If I go with adding a custom token, how would that token look or be structured? To reference this custom token would I need to change my blog post page path value under Settings? Currently: /news/{postSlug}.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Where you have [a-z0-9\-] use [a-z0-9\-\+]

Thanks Drew.

I now have:

'blogslug' => '[1-2][0-9]{3}\-[0-9]{2}\-[0-3][0-9]-[a-z0-9\-\+]+'

and I reinserted the title and saved the post again.

Unfortunately, I was still getting a "Page could not be found" result. Luckily, I went back and read the notes for Routing Tokens in my runway.php file and noticed that I needed to re-save the page options for the change to take effect. So I resubmitted my Page Options settings for my News and Post pages, and now the link works perfectly.

Thanks for all your help again!