Forum

Thread tagged as: Error, Events

Events. Class 'PerchBlog_Cache' not found in ... runtime.php on line 206

event.php (displaying details of an event) shows the event details but also reports: Fatal error: Class 'PerchBlog_Cache' not found in /var/sites/l/mywebsite.cymru/public_html/perch/addons/apps/perch_events/runtime.php on line 206

Here are the diagnostics:

Perch Runway: 2.8.10
Production mode: Production (100)
Installed apps: content (2.8.10), assets (2.8.10), categories (2.8.10), perch_events (1.9.2), collection_1 (2.8.10)
DB driver: PDO
DB tables: perch2_backup_plans, perch2_backup_resources, perch2_backup_runs, perch2_categories, perch2_category_counts, perch2_category_sets, perch2_collection_index, perch2_collection_items, perch2_collection_revisions, perch2_collections, perch2_content_index, perch2_content_items, perch2_content_regions, perch2_events, perch2_events_categories, perch2_events_to_categories, perch2_navigation, perch2_navigation_pages, perch2_page_routes, perch2_page_templates, perch2_pages, perch2_resource_log, perch2_resource_tags, perch2_resources, perch2_resources_to_tags, perch2_settings, perch2_user_privileges, perch2_user_role_privileges, perch2_user_roles, perch2_users
Users: 1
App runtimes:
<?php
    $apps_list = array(
        'content', 
        'categories',
        'perch_events',
    );
Scheduled tasks for perch_events: update_category_counts (60 mins)
Scheduled tasks for Backup: plan_2 (10 mins)
Editor plug-ins: markitup, ckeditor
H1: 78522d5977212132b6d95dc79c739fb0
L1: 0900b566c2079376e2fb8fdb471b7a9a
headerColour: #054d90
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 1
content_collapseList: 1
lang: en-gb
update_2.8.4: done
update_runway_2.8.10: done
headerScheme: dark
on_sale_version: 2.8.10
latest_version: 2.8.8
dashboard: 0
hide_pwd_reset: 0
content_hideNonEditableRegions: 0
content_frontend_edit: 0
logoPath: /perch/resources/cathedral_logo_runway.jpg
perch_events_update: 1.8
perch_events_detail_url: /events/event.php?s={eventSlug}
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_SITEPATH: /var/sites/l/mywebsite.cymru/public_html
PERCH_SCHEDULE_SECRET: unyWmRtR9S45lMIf
PERCH_DB_USERNAME: llanelwy_john
PERCH_DB_SERVER: 10.169.0.4
PERCH_DB_DATABASE: llanelwy_2015
PERCH_DB_PREFIX: perch2_
PERCH_EMAIL_FROM: admin@pipcreative.com
PERCH_EMAIL_FROM_NAME: John Liston
PERCH_LOGINPATH: /perch
PERCH_PATH: /var/sites/l/mywebsite.cymru/public_html/perch
PERCH_CORE: /var/sites/l/mywebsite.cymru/public_html/perch/core
PERCH_RESFILEPATH: /var/sites/l/mywebsite.cymru/public_html/perch/resources
PERCH_RESPATH: /perch/resources
PERCH_HTML5: 1
PERCH_DEBUG: 1
PERCH_TZ: UTC
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_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /var/sites/l/mywebsite.cymru/public_html/perch/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_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
HOSTING SETTINGS

PHP: 5.6.8
Zend: 2.6.0
OS: Linux
SAPI: cgi-fcgi
Safe mode: not detected
MySQL client: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $
MySQL server: 5.6.21
Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, gettext, SPL, iconv, session, json, ldap, mbstring, mcrypt, mssql, standard, mysql, mysqlnd, mysqli, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, Reflection, imap, SimpleXML, soap, sockets, exif, tidy, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, cgi-fcgi, memcached, memcache, mhash, ionCube Loader, Zend Guard Loader
GD: Yes
ImageMagick: No
PHP max upload size: 100M
PHP max form post size: 100M
PHP memory limit: 128M
Total max uploadable file size: 100M
Resource folder writeable: Yes
Session timeout: 240 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No
DOCUMENT_ROOT: /var/sites/l/mywebsite.cymru/public_html
GATEWAY_INTERFACE: CGI/1.1
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_ACCEPT_LANGUAGE: en-us
HTTP_CONNECTION: close
HTTP_COOKIE: cmsa=1; cmssb=0; PHPSESSID=62f3e86e6e3eedb776e46f8e6a81ae24
HTTP_HOST: mywebsite.cymru
HTTP_REFERER: https://mywebsite.cymru/perch/core/settings/diagnostics/
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12
HTTP_X_FORWARDED_FOR: 81.149.25.240
PATH: /bin
QUERY_STRING: extended
REDIRECT_STATUS: 200
REMOTE_ADDR: nn.nnn.nn.nnn
REMOTE_PORT: 51447
REQUEST_METHOD: GET
REQUEST_URI: /perch/core/settings/diagnostics/?extended
SCRIPT_FILENAME: /var/sites/l/mywebsite.cymru/public_html/perch/core/settings/diagnostics/index.php
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
SERVER_ADDR: 10.168.1.106
SERVER_ADMIN: you@example.com
SERVER_NAME: mywebsite.cymru
SERVER_PORT: 80
SERVER_PROTOCOL: HTTP/1.1
SERVER_SOFTWARE: Apache
PHP_SELF: /perch/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1438420505.64
REQUEST_TIME: 1438420505
argc: 1
John Liston

John Liston 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

That looks like a bug. We'll take a look into it.

The error message is not showing this morning. I'm testing at the moment and there is currently only one future event (dated today); all the others are past events.

Just added another event (for tomorrow) and the error still doesn't show.

I can't look at this any further now but will do some further testing later, if I can.

If I display all the events (there are only a handful) then the fatal error shows up on the events.php page (for any event). When I revert to showing only todays event (and this is the only future event) the error isn't there.

Add a second event for today and the error appears [on the detail page] for the second event but not for the first. Add a third event for today and the error shows for the second and third events but not for the first.

I could give you access to the backend if that would help but I'm away from my desk now until later today.

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Can you post the code for both of those cases?

This has been badly explained by me: my apologies.

I am using event.php which I have copied from the php files that come with the Events add-on app.

<?php include('../perch/runtime.php'); ?>
<?php 
    //we can get the event Title using perch_events_event_field
    $title = perch_events_event_field(perch_get('s'),'eventTitle',true);
?>
        <?php PerchUtil::output_debug(); ?>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>Event: <?php echo $title; ?></title>
    <?php perch_get_css(); ?>
    <link rel="stylesheet" href="events.css" type="text/css" />

</head>

<body>
    <header class="layout-header">
        <div class="wrapper">
            <div class="company-name">St Asaph Cathedral DEVELOPMENT testing events</div>
            <!-- <img src="<?php perch_path('feathers/quill/img/logo.gif'); ?>" alt="Your Logo Here" class="logo" /> -->
        </div>
        <nav class="main-nav">
            <?php perch_pages_navigation(array(
                    'levels'=>1
                ));
            ?>
        </nav>
    </header>

    <!--  change cols2-nav-right to cols2-nav-left if you want the sidebar on the left -->
    <div class="wrapper cols2-nav-right">

        <div class="primary-content">
            <h1>Event</h1>
            <?php       
                perch_events_custom(array(
                    'filter'=>'eventSlug',
                    'match'=>'eq',
                    'value'=>perch_get('s'),
                    'template'=>'listing/event-detail.html'
                ));
            ?>          
        </div>

        <nav class="sidebar">
            <!--  By category listing -->
            <?php perch_events_event_categories(perch_get('s')); ?>
        </nav>

    </div>

    <?php perch_get_javascript(); ?>

</body>
</html>

This displays a single event and I am calling it from another page using this piece of code:

<?php

                perch_events_custom(array(
                    'filter'=>'eventDateTime',
                    'match'=>'between',
                    'value' => date('Y-m-d 00:00:00'). ', ' . date('Y-m-d 23:59:59'),
                    'sort'=>'eventDateTime',
                    'sort-order'=>'desc',
                    'template'=>'listing/banner-listing.html'
                ));
?>

Until today every time I selected an event to display its details the events.php page displayed the cache not found error. But today there was only one future event remaining and when displaying this (using the same events.php code) no error was displayed.

Does this help?

John, edit perch_events/runtime.php inside your apps folder, line 206:

if ($r!='') PerchBlog_Cache::save_static($cache_key, $r);

and change it to:

if ($r!='') PerchEvents_Cache::save_static($cache_key, $r);

Another edit/fix you may want to do is on perch_events/PerchEvents_Cache.class.php lines 53 and 64, change:

PERCH_RESFILEPATH.'/perch_blog.'.$key.'.cache')

to

PERCH_RESFILEPATH.'/perch_events.'.$key.'.cache')

Thank you Andrés, worked for me. Hopefully these edits won't create additional errors, but they certainly make sense.

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Please do not edit core Perch or Add-on files. We cannot offer support once you are no longer using our code. This is also a month-old thread. If you are having an issue Seth then please ensure you are using an unedited Events app and post your Diagnostic Report so we can actually see what is happening in your case.