Forum

Thread tagged as: Problem, Error, Addons

Errors after Perch upgrade (2.4.9 to 2.7.2)

Hi. We're experiencing a bunch of errors after upgrading our client's version of Perch from 2.4.9 to 2.7.2. The problem occurs when they try to save changes to a content region:

PHP Warning:  json_encode(): Invalid UTF-8 sequence in argument in /admin/core/lib/PerchUtil.class.php on line 535

PHP Fatal error:  Call to undefined method PerchAdmin::event() in /admin/core/apps/content/PerchContent_Region.class.php on line 381

First we upgraded Perch following the update instructions, disabling each of their installed apps beforehand. Then we went back and upgraded each app (Events, Forms and Gallery) one-by-one, and then re-enabled them.

Any advice on how to correct this problem would be great. Thanks.

James Harrison

James Harrison 0 points

  • 7 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Can we see your Diagnostic Report please?

Sure. Here it is:

Perch: 2.7.2
Production mode: Production (100)
Installed apps: content (2.7.2), perch_forms (1.8.1), perch_gallery (2.8.5), perch_events (1.9)
DB driver: PDO
DB tables: perch2_categories, perch2_category_counts, perch2_category_sets, perch2_content_index, perch2_content_items, perch2_content_regions, perch2_events, perch2_events_categories, perch2_events_to_categories, perch2_forms, perch2_forms_responses, perch2_gallery_albums, perch2_gallery_image_versions, perch2_gallery_images, perch2_navigation, perch2_navigation_pages, 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: 2
App runtimes:
<?php
$apps_list = array(
    'content', 
    'categories',
    'perch_events',
    'perch_gallery',
    'perch_forms',
);
Scheduled tasks for perch_events: update_category_counts (60 mins)
Editor plug-ins: markitup, tinymce
H1: 90399a593b516bb74104b96fa46f5581
L1: eb380f7f47096ab5018a95ec2acc24a0
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 1
content_collapseList: 1
lang: en-gb
latest_version: 2.5.3
headerScheme: light
dashboard: 0
content_hideNonEditableRegions: 0
perch_events_detail_url: /events/event.php?event={eventSlug}
perch_gallery_basicUpload: 0
logoPath: /admin/resources/logo.png
update_2.4.9: done
on_sale_version: 2.7.2
update_2.7.2: done
perch_gallery_update: 2.8.5
perch_events_update: 1.8
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_DATABASE: db_live
PERCH_DB_USERNAME: db_live
PERCH_DB_SERVER: localhost
PERCH_DB_PREFIX: perch2_
PERCH_EMAIL_FROM: example@example.com
PERCH_EMAIL_FROM_NAME: Example Example
PERCH_LOGINPATH: /admin
PERCH_PATH: /httpdocs/admin
PERCH_CORE: /httpdocs/admin/core
PERCH_RESFILEPATH: /httpdocs/admin/resources
PERCH_RESPATH: /admin/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_DEBUG:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /httpdocs/admin/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
HOSTING SETTINGS

PHP: 5.3.5
Zend: 2.3.0
OS: Linux
SAPI: apache2handler
Safe mode: not detected
MySQL client: 5.1.54
MySQL server: 5.1.54
Extensions: Core, date, ereg, libxml, openssl, pcre, zlib, bz2, calendar, ctype, hash, filter, ftp, gettext, gmp, SPL, iconv, Reflection, session, standard, shmop, SimpleXML, sockets, exif, tokenizer, xml, apache2handler, apc, curl, dom, fileinfo, gd, imap, json, ldap, mbstring, mcrypt, mysql, mysqli, odbc, PDO, pdo_mysql, PDO_ODBC, pdo_sqlite, Phar, snmp, wddx, xmlreader, xmlrpc, xmlwriter, xsl, zip
GD: Yes
ImageMagick: No
PHP max upload size: 10M
PHP max form post size: 8M
PHP memory limit: 128M
Total max uploadable file size: 8M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No
SCRIPT_URL: /admin/core/settings/diagnostics/
SCRIPT_URI: https://www.example.com/admin/core/settings/diagnostics/
PP_CUSTOM_PHP_INI: /etc/php.ini
HTTP_HOST: www.example.com
HTTP_CONNECTION: keep-alive
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36
HTTP_DNT: 1
HTTP_REFERER: https://www.example.com/admin/core/settings/diagnostics/
HTTP_ACCEPT_ENCODING: gzip,deflate,sdch
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8
HTTP_COOKIE: PHPSESSID=0sdtradbii489ekulvunojjjg7; cmsa=1
PATH: /sbin:/usr/sbin:/bin:/usr/bin
SERVER_SIGNATURE: <address>Apache Server at www.example.com Port 80</address>
SERVER_SOFTWARE: Apache
SERVER_NAME: www.example.com
SERVER_ADDR: 216.70.89.148
SERVER_PORT: 80
REMOTE_ADDR: 137.186.147.84
DOCUMENT_ROOT: /httpdocs
SERVER_ADMIN: example@example.com
SCRIPT_FILENAME: /httpdocs/admin/core/settings/diagnostics/index.php
REMOTE_PORT: 54136
GATEWAY_INTERFACE: CGI/1.1
SERVER_PROTOCOL: HTTP/1.1
REQUEST_METHOD: GET
QUERY_STRING: extended
REQUEST_URI: /admin/core/settings/diagnostics/?extended
SCRIPT_NAME: /admin/core/settings/diagnostics/index.php
PHP_SELF: /admin/core/settings/diagnostics/index.php
REQUEST_TIME: 1415297352

On a side note, it would be nice if the diagnostic report omitted the PERCH_MAILER_PASSWORD variable, like it does the DB_PASSWORD one. Just something I've noticed. Cheers.

Drew McLellan

Drew McLellan 2638 points
Perch Support

There should be a brief report that doesn't include all that stuff.

Does this happen with all regions, or just some?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Does it make a difference if you add the following to your config.php file?

define('PERCH_DB_CHARSET', 'latin1');

Hi Drew. Adding that extra constant doesn't appear to make a difference.

Yes, it occurs when saving any region on any page. I've also noticed that an error occurs during login too:

PHP Fatal error:  Call to undefined method PerchAdmin::event() in /admin/core/lib/PerchAuthenticatedUser.class.php on line 96

PHP Fatal error:  Call to undefined method PerchAdmin::event() in /admin/core/apps/content/PerchContent_Region.class.php on line 381

Basically, the login stops on a blank page (because I have display_errors turned off). I then have to refresh the blank page again to actually get logged in.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Is it possible you might not have a complete set of files?

Hi Drew. I think I've fixed the issue. I compared all the files in version control and somehow it looks like when we overwrote the old core folder with the new one the PerchAdmin class file never got copied. Now I've updated that file everything appears to work nicely.

Thanks for your help.