Forum

Thread tagged as: Question, Error, Blog

Imported Wordpress posts stopping page load once it gets to the template

I have imported about 50 posts from a Wordpress site using the perch importer. They all show up in the perch dashboard fine, and when I changed the post template to ckeditor, they retained the formatting and everything. Looks perfect on the back end.

When I use on of the perch functions to show any information on the page, the html gets to the function, and then the page stops loading any element after, and no posts show up. I'll use the index as an example:

<?php include('../perch/runtime.php'); ?>
<?php perch_layout('head'); ?>

            <h1>Blog</h1>

            <?php perch_blog_recent_posts(10); ?>

            <p><a href="archive.php">More posts</a></p>

<?php perch_layout('footer'); ?>

Up to the blog heading loads fine, and then nothing. I turned on debugging, and placing it anywhere above perch_blog_recent_posts shows a result, but after it shows nothing.

Here is the post_in_list.html (it is pretty much default I think)

<perch:before>
  <ul class="blog--list">
</perch:before>

  <li class="blog--card bg-dark-grey text-white pad">

    <div class="blog--card-image" style="background-image:url('<perch:blog id="image" type="image" crop="false" />" alt="<perch:blog id="postTitle" />'(" />
    </div>

    <div class="blog--card-content">

      <h2 class="blog--card-heading"><perch:blog id="postTitle" /></h2>
      <p class="blog--card-author"><perch:blog id="authorGivenName" type="text" label="Given name" order="1" />  <perch:blog id="authorFamilyName" type="text" label="Given name" order="2" /></p>
      <p class="blog--card-date"><perch:blog id="postDateTime" format="%d %B %Y" /></p>
      <div class="blog--card-summary">
        <perch:blog id="excerpt" type="textarea" textile="true" words="25" append="..."  />
      </div>
      <div class="blog--card-button">
        <a href="<perch:blog id="postURL" />" rel="bookmark" class="blog--card-title">
          <button class="button button--outline-yellow text-whites">Read More</button>
        </a>
      </div>
    </div>

  </li>

<perch:after>
  </ul>
    <perch:if exists="paging">
        <div class="paging">
            Page <perch:blog id="current_page" /> of <perch:blog id="number_of_pages" />
            <perch:blog id="page_links" encode="false" />
            <perch:if exists="not_first_page">
                <a href="<perch:blog id="prev_url" encode="false" />">Previous</a>
            </perch:if>
            <perch:if exists="not_last_page">
                <a href="<perch:blog id="next_url" encode="false" />">Next</a>
            </perch:if>
        </div>
    </perch:if>
</perch:after>

I haven't come across a way to debug templates that I am aware of.

Here is the Diagnostics:

Perch LTM: 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)
DB driver: PDO
DB tables: perch3_blog_authors (18), perch3_blog_comments (0), perch3_blog_index (6264), perch3_blog_posts (234), perch3_blog_posts_to_tags (28), perch3_blog_sections (1), perch3_blog_tags (17), perch3_blogs (1), perch3_categories (10), perch3_category_counts (4), perch3_category_sets (1), perch3_content_index (18), perch3_content_items (12), perch3_content_regions (148), perch3_menu_items (9), perch3_navigation (1), perch3_navigation_pages (5), perch3_page_templates (5), perch3_pages (58), perch3_resource_log (2), perch3_resource_tags (0), perch3_resources (2), perch3_resources_to_tags (0), perch3_settings (13), perch3_user_passwords (0), perch3_user_privileges (35), perch3_user_role_privileges (2), perch3_user_roles (2), perch3_users (1)
Users: 1
App runtimes:
<?php
    $apps_list = [ 
    ];
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Editor plug-ins: ckeditor
H1: 421aa90e079fa326b6494f812ad13e79
L1: 00b88a19498d3cd34cc8f92156a714e9
F1: 0c66c2e1f82f9e0b7617b2cb8270f2c7
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 0
content_collapseList: 1
lang: en-gb
installedAt: 3.0.4
update_3.0.4: done
latest_version:
on_sale_version: 3.0.5
perch_blog_update: 5.0.1
perch_blog_post_url: /blog/post.php?s={postSlug}
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: root
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: itfutures
PERCH_DB_PREFIX: perch3_
PERCH_TZ: UTC
PERCH_EMAIL_FROM: locky@moworks.com.au
PERCH_EMAIL_FROM_NAME: Dev Moworks
PERCH_DEBUG: 1
PERCH_LOGINPATH: /perch
PERCH_PATH: /Users/lockykeaney/moworks/itfutures/www/perch
PERCH_CORE: /Users/lockykeaney/moworks/itfutures/www/perch/core
PERCH_RESFILEPATH: /Users/lockykeaney/moworks/itfutures/www/perch/resources
PERCH_RESPATH: /perch/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_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /Users/lockykeaney/moworks/itfutures/www/perch/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: 7.0.0
Zend: 3.0.0
OS: Darwin
SAPI: apache2handler
Safe mode: not detected
MySQL client: mysqlnd 5.0.12-dev - 20150407 - $Id: 7e72f9690b1498a1bead7a637c33a831c0d2f655 $
MySQL server: 5.5.42
Free disk space: 26.79 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, exif, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, zip, apache2handler, imap, mcrypt, pgsql, pdo_pgsql
GD: Yes
ImageMagick: No
PHP max upload size: 32M
PHP max form post size: 32M
PHP memory limit: 128M
Total max uploadable file size: 32M
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_12_5) 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_DNT: 1
HTTP_REFERER: https://localhost:8888/perch/core/settings/diagnostics/
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch, br
HTTP_ACCEPT_LANGUAGE: en-GB,en-US;q=0.8,en;q=0.6
HTTP_COOKIE: _hjIncludedInSample=1; PHPSESSID=47ff40688e71e56275ab02eff7bb6bbe; cmsa=1; SQLiteManager_currentLangue=2; io=HZwHP_50GiSD0yM3AAAJ
PATH: /usr/bin:/bin:/usr/sbin:/sbin
SERVER_SOFTWARE: Apache/2.2.29 (Unix) mod_wsgi/3.5 Python/2.7.10 PHP/7.0.0 mod_ssl/2.2.29 OpenSSL/0.9.8zh DAV/2 mod_fastcgi/2.4.6 mod_perl/2.0.9 Perl/v5.22.0
SERVER_NAME: localhost
SERVER_ADDR: ::1
SERVER_PORT: 8888
REMOTE_ADDR: ::1
DOCUMENT_ROOT: /Users/lockykeaney/moworks/itfutures/www
SERVER_ADMIN: you@example.com
SCRIPT_FILENAME: /Users/lockykeaney/moworks/itfutures/www/perch/core/settings/diagnostics/index.php
REMOTE_PORT: 49999
GATEWAY_INTERFACE: CGI/1.1
SERVER_PROTOCOL: HTTP/1.1
REQUEST_METHOD: GET
QUERY_STRING: extended
REQUEST_URI: /perch/core/settings/diagnostics/?extended
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
PHP_SELF: /perch/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1496367289.6
REQUEST_TIME: 1496367289
argc: 1
Locky Keaney

Locky Keaney 0 points

  • 4 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

What is in your PHP error log when that happens?

I am getting

PHP Fatal error:  Uncaught Error: Call to undefined function perch_blog_recent_posts()

as the latest entry in the logs.

This is the first time I have used the blog app with the new version of perch, is the process of getting running different? I added the app to the app list, but still the same error.

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Please show me your Diagnostics now you have added perch_blog.

I got it working thanks. There was a small update that needed to be done, and I reinstalled the addon downloaded from the site. I guess I had some files in the wrong places.