We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Problem, Error, Installation

Upgrade Errors

I work on a site that uses Perch and Perch Blog. Everything was running well with Perch 2.7.10 and Perch Blog 4.5.4. Yesterday I decided to upgrade to the current versions (Perch 2.8.2 and Perch Blog4.6) and I encountered problems and was forced to reverse the upgrade.

When I upgraded both Perch ( with the markup editor upgrade) and the Blog and tried to add a blog post I got the following runtime error.

Fatal error: Call to undefined function perch_get() in /home/castfile/public_html/perch/addons/apps/perch_blog/runtime.php on line 748

When I just replaced the Blog to the previous version and tried to save a new blog post with Perch upgraded I got the following runtime error.

Fatal error: Call to a member function return_instance() on a non-object in /home/casttester/public_html/perch/core/lib/api/PerchAPI_Form.class.php on line 408

I also noticed that on the post entry form that the field I had defined to use ckeditor was not rendered with the ckeditor.

I put the original markitup editor folder back. Still got the runtime error. I put the original perch core back and everything worked again.

I need upgrade help. It has always worked before. Any suggestions????

Diagnostic Report

Diagnostics report
HEALTH CHECK

Perch is out of date. You are running Perch 2.7.10 and the latest is 2.8.2. Update instructions
PHP 5.3.28 is very out of date. More info
MySQL 5.1.73-cll is up to date
Image processing available
File upload size is low. You can only upload files up to 2M.
Memory limit is low. Memory use is limited to 32M, which could cause problems manipulating large images.
SUMMARY INFORMATION

Perch: 2.7.10, PHP: 5.3.28, MySQL: 5.1.70, with MySQLi
Server OS: Linux, apache2handler
Installed apps: content (2.7.10), assets (2.7.10), categories (2.7.10), perch_blog (4.5.4), perch_events (1.7.1), perch_news (4.1), perch_backup (1.2)
App runtimes: <?php $apps_list = array( 'content', 'categories', ); /* include(PERCH_PATH.'/core/apps/content/runtime.php'); */ include(PERCH_PATH.'/addons/apps/perch_blog/runtime.php'); include(PERCH_PATH.'/addons/apps/perch_news/runtime.php'); include(PERCH_PATH.'/addons/apps/perch_events/runtime.php'); ?>
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/casttester/public_html/perch
PERCH_CORE: /home/casttester/public_html/perch/core
PERCH_RESFILEPATH: /home/casttester/public_html/perch/resources
Image manipulation: GD
PHP limits: Max upload 2M, Max POST 8M, Memory: 32M, Total max file upload: 2M
Resource folder writeable: Yes
HTTP_HOST: www.castfiles.com
DOCUMENT_ROOT: /home/casttester/public_html
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

blog's post.html

<title><perch:blog id="postTitle"> by CAST, Inc.</title>
<style type="text/css">
.blogaddthis img{
    margin: 0px;
    padding: 0px;
}
</style>
<div class="hentry">
    <h1>
        <a href="<perch:blog id="postURL" type="hidden" />" rel="bookmark" class="entry-title">
            <perch:blog id="postTitle" type="textarea" label="Title" required="true" editor="markitup" size="xs autowidth" order="1" count="chars"/>
        </a>
    </h1>
    <p class="entry-published date">
        <perch:blog id="postDateTime" type="date" label="Date" time="true" format="%B %d %Y" divider-before="Meta information" /> 
        <!-- <perch:if exists="authorGivenName">
            by <perch:blog id="authorGivenName" type="hidden" /> <perch:blog id="authorFamilyName" type="hidden" />-->
        </perch:if>
    </p>
    <perch:if exists="image">
        <div>
            <img src="<perch:blog id="image" type="image" width="320" height="240" crop="true" label="Post Image" order="3" />" alt="<perch:blog id="postTitle" />" />
        </div>
    </perch:if>
     <perch:blog id="thumbnail-image" type="image" label="Thumbnail Image (50x50)" width="50" height="50" order="4" suppress="true" />
     <perch:categories id="categories" set="blog" label="Categories" display-as="checkboxes">
    <a href="archive.php?cat=<perch:category id="catSlug" type="slug" />">
        <perch:category id="catTitle" type="text" suppress="true"/>
    </a>
</perch:categories>
    <div class="description entry-content">
        <perch:blog id="postDescHTML" type="textarea" label="Post" order="2" editor="ckeditor" textile="false" markdown="false" html="true" count="chars"/>
    </div>
</div>

<perch:blog id="excerpt" type="textarea" encode="false" label="Meta Description / Excerpt" editor="markitup" textile="false" order="5" suppress="true" count="chars" size="xs"/>

<perch:blog id="metaKeywords" type="textarea" encode="false" label="Meta Keywords" editor="markitup" textile="false" order="6" suppress="true" count="chars" size="xs"/>

<perch:blog id="image" type="image" width="50" height="50" crop="true" suppress="true" />

Sue Stewart

Sue Stewart 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Change your apps.php from this:

 <?php 
$apps_list = array( 'content', 'categories', ); 
/* include(PERCH_PATH.'/core/apps/content/runtime.php'); */ include(PERCH_PATH.'/addons/apps/perch_blog/runtime.php'); include(PERCH_PATH.'/addons/apps/perch_news/runtime.php'); include(PERCH_PATH.'/addons/apps/perch_events/runtime.php'); 
?>

to this:

<?php 
$apps_list = array( 'content', 'categories', 'perch_blog', 'perch_news', 'perch_events'); 

I reinstalled the new version of Perch and Markitup and made the change to $apps_list and when I tried to input a blog post I got this error:

Fatal error: Call to a member function return_instance() on a non-object in /home/casttester/public_html/perch/core/lib/api/PerchAPI_Form.class.php on line 408

Also on the form the post content entry (postDescHTML0 did not render with the ckeditor.


Diagnostics report HEALTH CHECK Perch is up to date PHP 5.3.28 is very out of date. More info MySQL 5.1.73-cll is up to date Image processing available File upload size is low. You can only upload files up to 2M. Memory limit is low. Memory use is limited to 32M, which could cause problems manipulating large images. SUMMARY INFORMATION Perch: 2.8.2, PHP: 5.3.28, MySQL: 5.1.70, with MySQLi Server OS: Linux, apache2handler Installed apps: content (2.8.2), assets (2.8.2), categories (2.8.2), perch_blog (4.5.4), perch_events (1.7.1), perch_news (4.1), perch_backup (1.2) App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_news', 'perch_events'); include(PERCH_PATH.'/core/apps/content/runtime.php'); include(PERCH_PATH.'/addons/apps/perch_blog/runtime.php'); include(PERCH_PATH.'/addons/apps/perch_news/runtime.php'); include(PERCH_PATH.'/addons/apps/perch_events/runtime.php'); ?> PERCH_LOGINPATH: /perch PERCH_PATH: /home/casttester/public_html/perch PERCH_CORE: /home/casttester/public_html/perch/core PERCH_RESFILEPATH: /home/casttester/public_html/perch/resources Image manipulation: GD PHP limits: Max upload 2M, Max POST 8M, Memory: 32M, Total max file upload: 2M Resource folder writeable: Yes HTTP_HOST: www.castfiles.com DOCUMENT_ROOT: /home/casttester/public_html REQUEST_URI: /perch/core/settings/diagnostics/ SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Rachel Andrew

Rachel Andrew 394 points
Perch Support

You need to upgrade Blog and ckeditor to the latest versions.

After updating Blog and ckeditor I still have two problems.

When I go to the form to enter in a new blog post, the postDescHTML entry field is not rendering with the ckeditor as it did before all my updates. Next please see how I defined the field in my post.html. Looks like it is rendering as a markitup field perhaps, or nothing.

 <div class="description entry-content">
        <perch:blog id="postDescHTML" type="textarea" label="Post" order="2" editor="ckeditor" html="true" count="chars"/>
    </div>

But the good news is I can save a blog entry without getting a runtime error, but I really need to be able to use ckeditor for this field.

Next, if I go to any page in my site that contains the php line to include perch:


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

I get this runtime error right away.


Fatal error: Cannot redeclare perch_content() (previously declared in /home/casttester/public_html/perch/core/apps/content/runtime.php:19) in /home/casttester/public_html/perch/core/apps/content/runtime.php on line 37

Here is my Perch diagnostic:


Diagnostics report HEALTH CHECK Perch is up to date PHP 5.3.28 is very out of date. More info MySQL 5.1.73-cll is up to date Image processing available File upload size is low. You can only upload files up to 2M. Memory limit is low. Memory use is limited to 32M, which could cause problems manipulating large images. SUMMARY INFORMATION Perch: 2.8.2, PHP: 5.3.28, MySQL: 5.1.70, with MySQLi Server OS: Linux, apache2handler Installed apps: content (2.8.2), assets (2.8.2), categories (2.8.2), perch_blog (4.6), perch_events (1.7.1), perch_news (4.1), perch_backup (1.2) App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_news', 'perch_events'); include(PERCH_PATH.'/core/apps/content/runtime.php'); include(PERCH_PATH.'/addons/apps/perch_blog/runtime.php'); include(PERCH_PATH.'/addons/apps/perch_news/runtime.php'); include(PERCH_PATH.'/addons/apps/perch_events/runtime.php'); ?> PERCH_LOGINPATH: /perch PERCH_PATH: /home/casttester/public_html/perch PERCH_CORE: /home/casttester/public_html/perch/core PERCH_RESFILEPATH: /home/casttester/public_html/perch/resources Image manipulation: GD PHP limits: Max upload 2M, Max POST 8M, Memory: 32M, Total max file upload: 2M Resource folder writeable: Yes HTTP_HOST: www.castfiles.com DOCUMENT_ROOT: /home/casttester/public_html REQUEST_URI: /perch/core/settings/diagnostics/ SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

Thanks in advance for your further help.

Rachel Andrew

Rachel Andrew 394 points
Perch Support

That runtime error means you are including the runtime twice, your apps.php looks to be incorrect as you have included both the old and new format. Use one of these not both.

Okay, the runtime error is gone. I still have the second issue.

When I go to the form to enter in a new blog post, the postDescHTML entry field is not rendering with the ckeditor as it did before all my updates. Next please see how I defined the field in my post.html. Looks like it is rendering as a markitup field perhaps, or nothing.

 <div class="description entry-content">
        <perch:blog id="postDescHTML" type="textarea" label="Post" order="2" editor="ckeditor" html="true" count="chars"/>
    </div>

Thanks in advance for your help.

Rachel Andrew

Rachel Andrew 394 points
Perch Support

What are you actually seeing in the control panel?

Are there any errors in your browser console?

I do not see any errors in the browser console? Would they be anywhere besides on the page? I am using Chrome, but checked in IE as well and it is the same.

I am including two print screens :

The first: http://www.suebstewart.com/control-panel-after.png is what renders after the upgrade, The second: http://www.suebstewart.com/control-panel-before.png is what rendered before the upgrade.

control panel after upgrade control panel before upgrade

This is post.html

<title><perch:blog id="postTitle"> by CAST, Inc.</title>
<style type="text/css">
.blogaddthis img{
    margin: 0px;
    padding: 0px;
}
</style>
<div class="hentry">
    <h1>
        <a href="<perch:blog id="postURL" type="hidden" />" rel="bookmark" class="entry-title">
            <perch:blog id="postTitle" type="textarea" label="Title" required="true" editor="markitup" size="xs autowidth" order="1" count="chars"/>
        </a>
    </h1>
    <p class="entry-published date">
        <perch:blog id="postDateTime" type="date" label="Date" time="true" format="%B %d %Y" divider-before="Meta information" /> 
        <!-- <perch:if exists="authorGivenName">
            by <perch:blog id="authorGivenName" type="hidden" /> <perch:blog id="authorFamilyName" type="hidden" />-->
        </perch:if>
    </p>
    <perch:if exists="image">
        <div>
            <img src="<perch:blog id="image" type="image" width="320" height="240" crop="true" label="Post Image" order="3" />" alt="<perch:blog id="postTitle" />" />
        </div>
    </perch:if>
     <perch:blog id="thumbnail-image" type="image" label="Thumbnail Image (50x50)" width="50" height="50" order="4" suppress="true" />
     <perch:categories id="categories" set="blog" label="Categories" display-as="checkboxes">
    <a href="archive.php?cat=<perch:category id="catSlug" type="slug" />">
        <perch:category id="catTitle" type="text" suppress="true"/>
    </a>
</perch:categories>
    <div class="description entry-content">
        <perch:blog id="postDescHTML" type="textarea" label="Post" order="2" editor="ckeditor" textile="false" markdown="false" html="true" count="chars"/>
    </div>
</div>

<perch:blog id="excerpt" type="textarea" encode="false" label="Meta Description / Excerpt" editor="markitup" textile="false" order="5" suppress="true" count="chars" size="xs"/>

<perch:blog id="metaKeywords" type="textarea" encode="false" label="Meta Keywords" editor="markitup" textile="false" order="6" suppress="true" count="chars" size="xs"/>

<perch:blog id="image" type="image" width="50" height="50" crop="true" suppress="true" />


Rachel Andrew

Rachel Andrew 394 points
Perch Support

There are various errors in this template. The main one being that you have commented out part of a perch:if statement.

If you don't want the author information to appear remove it.

<!-- <perch:if exists="authorGivenName">
            by <perch:blog id="authorGivenName" type="hidden" /> <perch:blog id="authorFamilyName" type="hidden" />-->
        </perch:if>

You have a strange mixture of markitup and ckeditor. You never need to set markdown or textile to false, just don't include the attributes. You also have included markitup on fields that have no ability to accept html, textile OR markdown which is redundant.

So the first thing to do would be to check that your template is correct.

I was very hopeful it was errors in my template. I think it is more. I replaced my post.html with the example post.html supplied with the new version of blog. It worked. I altered just one div to use ckeditor

 <div class="description e-content">
        <perch:blog id="postDescHTML" type="textarea" label="Post" order="2" editor="ckeditor" html="true" />
    </div>

The field still did not render with ckeditor. I tried my IE browser that I had not tried since having the runtime errors ( I have script debugging set on this browser) and this time I got script errors.

I looked at the ckeditor folder that I installed and it said to check a certain page to see if the install was good and that page displayed nicely.

Here are the script errors I received in the order they were received: Thank you in advance for your help with my problem.

First Second Third Forth

Drew McLellan

Drew McLellan 2638 points
Perch Support

Which version of IE is that?

Version 9. I had uninstalled the more recent versions a few weeks ago for a task I was working on.

I just upgraded to Version 11 and I still get errors. Two. Below please find the screen shots in the order they were received.

First Second

Drew McLellan

Drew McLellan 2638 points
Perch Support

Is it our version of the CKEditor plugin you're using, or one of your own?

I did download the version of ckeditor I installed from your site yesterday. In my double checking I noticed that the ckeditor zip file I downloaded from your site yesterday had a different number than the one I downloaded today. I installed the version I downloaded today and the ckeditor renders from post.html.

Thanks for all your help.