Forum

Thread tagged as: Problem, Error, Installation

MarkItUp gone bad after update to 2.8.29?

Hi, I just updated perch to 2.8.29 for a client, but it seems something with MarkItUp has gone bad on the production server. HTML in textareas have stopped working.

My development server for the same site works after the update. BUT, the UI:s differ when editing textfields! The development server looks good, the production server looks old (non-retina graphics)! The files in addons/plugins/editors/markitup are not the same. The production server has a both a config.js and a settings.js file for example - the dev server has all settings in config.js.

It seems like the production server update has not worked as it should. What should I do to get it in order?

From the production server: Perch: 2.8.29, PHP: 5.3.17, MySQL: mysqlnd 5.0.8-dev - 20102224 - $Id: 65fe78e70ce53d27a6cd578597722950e490b0d0 $, with PDO Server OS: FreeBSD, fpm-fcgi Installed apps: content (2.8.29), assets (2.8.29), categories (2.8.29)

Regards, Asker

Asker Brodersen

Asker Brodersen 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

If the files aren't the same, upload the new files.

Replaced markitup directory with the copy from my dev server. Now MarkItUp looks updated. But the problem with html in the textarea remains.

This markdown:

Viltstängsel - stänga inne vilt
==================
<span style=color:green>För att stänga inne vilt t.ex hjortar/älgar</span>
------------------

Turns into this html:

<h2><span style=color:green>För att stänga inne vilt t.ex hjortar/älgar</span></h2>

And this only happens on the production server, which btw runs with a production database. Is there any Perch setting stored in the database that can affect this?

The template for the region is:

<header class="header">
    <div class="l-box page-intro">
        <perch:content id="text" type="textarea" label="Text" markdown="true" editor="markitup" imagewidth="640" imageheight="480" />
    </div>
</header>

Regards, Asker

Rachel Andrew

Rachel Andrew 394 points
Perch Support

If you want to use html in a textarea you need to add html="true" to the Perch template tag otherwise Perch will encode it.

Thanks Rachel, that worked!

Is this a newish requirement as I don't recall changing the template? (The devserver showed the content OK as the content was already saved correctly in the database, when editing and saving a region it went bad like the production server.)

Drew McLellan

Drew McLellan 2638 points
Perch Support

No, it's always been that way.

Did you update markitup too? There was an update to it in Nov 2015

Same installation, related error: Template:

<div class="l-box product-listing-overview">
    <perch:content id="text" type="textarea" label="Text" markdown="true" editor="markitup" html="true" imagewidth="350" imagequality="65" imagesharpen="0" imagedensity="2"/>
</div>

The following in the textarea:

Text before
<div class=big-right>![ESM 5500i GSM](/perch/resources/5500igsm-1-w350@2x.jpg)</div> 
Text after

After re-saving the content / editing the text, the page now shows no picture, just

![ESM 5500i GSM](/perch/resources/5500igsm-1-w350@2x.jpg)

I've quick-fixed it with

Text before
<div class=big-right><img src="/perch/resources/5500igsm-1-w350@2x.jpg"></div>
Text after

But as soon as the editor changes another text on another page using the same template the same problem will occur. Why is this happening after the update, and what can I do about it?

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Can we see your Diagnostics Report?

Plus the complete template.

Here it is, domain name changed though.

Basic diagnostics:

Perch: 2.8.29, PHP: 5.3.17, MySQL: mysqlnd 5.0.8-dev - 20102224 - $Id: 65fe78e70ce53d27a6cd578597722950e490b0d0 $, with PDO
Server OS: FreeBSD, fpm-fcgi
Installed apps: content (2.8.29), assets (2.8.29), categories (2.8.29)
App runtimes: <?php include(PERCH_PATH.'/core/apps/content/runtime.php'); ?>
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/www/vhosts/www.somedomain.se/htdocs/perch
PERCH_CORE: /home/www/vhosts/www.somedomain.se/htdocs/perch/core
PERCH_RESFILEPATH: /home/www/vhosts/www.somedomain.se/htdocs/perch/resources
Image manipulation: GD
PHP limits: Max upload 10M, Max POST 8M, Memory: 48M, Total max file upload: 8M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
HTTP_HOST: somedomain.se
DOCUMENT_ROOT: /home/www/vhosts/somedomain.se/htdocs
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

Complete content template:

<div class="l-box product-listing-overview">
    <perch:content id="text" type="textarea" label="Text" markdown="true" editor="markitup" html="true" imagewidth="350" imagequality="65" imagesharpen="0" imagedensity="2"/>
</div>

Complete diagnostics:

PERCH INFORMATION

Perch: 2.8.29
Production mode: Production (100)
Installed apps: content (2.8.29), assets (2.8.29), categories (2.8.29)
DB driver: PDO
DB tables: perch2_categories (0), perch2_category_counts (0), perch2_category_sets (0), perch2_content_index (36816), perch2_content_items (4472), perch2_content_regions (140), perch2_navigation (0), perch2_navigation_pages (0), perch2_page_templates (4), perch2_pages (37), perch2_resource_log (9790), perch2_resource_tags (0), perch2_resources (1327), perch2_resources_to_tags (0), perch2_settings (21), perch2_user_passwords (0), perch2_user_privileges (27), perch2_user_role_privileges (15), perch2_user_roles (2), perch2_users (2)
Users: 2
App runtimes:
<?php
    include(PERCH_PATH.'/core/apps/content/runtime.php');
?>
Editor plug-ins: markitup_old, markitup
H1: 7db4928a227ec86e769cd8e5beea2c25
L1: 1e21fe18bb7535c4dad6dc53d27c2f8d
F1: 2edba60ed1f613d6dd804feb202456a2
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 0
content_collapseList: 1
lang: en-gb
update_2.4.2: done
latest_version: 2.8.15
on_sale_version: 2.8.29
headerScheme: light
content_frontend_edit: 1
dashboard: 0
content_hideNonEditableRegions: 0
update_2.4.3: done
update_2.4.5: done
update_2.4.6: done
update_2.8.29: done
hide_pwd_reset: 0
logoPath: /perch/resources/logo.png
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: someother
PERCH_DB_SERVER: db.someother.com
PERCH_DB_DATABASE: someother
PERCH_DB_PREFIX: perch2_
PERCH_TZ: Europe/Stockholm
PERCH_EMAIL_FROM: info@ someother
PERCH_EMAIL_FROM_NAME: someother info
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/www/vhosts/www.somedomain.se/htdocs/perch
PERCH_CORE: /home/www/vhosts/www.somedomain.se/htdocs/perch/core
PERCH_RESFILEPATH: /home/www/vhosts/www.somedomain.se/htdocs/perch/resources
PERCH_RESPATH: /perch/resources
PERCH_HTML5: 1
PERCH_CLEAN_RESOURCES: 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_DEBUG:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /home/www/vhosts/www.somedomain.se/htdocs/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_PARANOID:
PERCH_FORCE_SECURE_COOKIES:
PERCH_PASSWORD_MIN_LENGTH: 6
PERCH_MAX_FAILED_LOGINS: 10
PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR
PERCH_VERIFY_UPLOADS:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_SESSION_TIMEOUT_MINS: 20
HOSTING SETTINGS

PHP: 5.3.17
Zend: 2.3.0
OS: FreeBSD
SAPI: fpm-fcgi
Safe mode: not detected
MySQL client: mysqlnd 5.0.8-dev - 20102224 - $Id: 65fe78e70ce53d27a6cd578597722950e490b0d0 $
MySQL server: 5.0.92-log
Free disk space: 126.37 GB
Extensions: Core, date, ereg, libxml, pcre, Reflection, SPL, hash, session, cgi-fcgi, gd, filter, zlib, standard, recode, curl, ctype, fileinfo, xml, mysqlnd, mysqli, json, posix, shmop, xmlrpc, sockets, imap, dom, xmlreader, iconv, openssl, exif, bcmath, zip, mbstring, bz2, readline, tokenizer, PDO, pdo_mysql, mysql, SQLite, soap, SimpleXML, gettext, xmlwriter, mcrypt, Phar, pgsql, pdo_pgsql, pdo_sqlite, sqlite3, mhash, ionCube Loader
GD: Yes
ImageMagick: No
PHP max upload size: 10M
PHP max form post size: 8M
PHP memory limit: 48M
Total max uploadable file size: 8M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No
PATH: /sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin
FCGI_ROLE: RESPONDER
REDIRECT_UNIQUE_ID: VzXKdtioh7UAAJMsk98AAABF
REDIRECT_SCRIPT_URL: /perch/core/settings/diagnostics/
REDIRECT_SCRIPT_URI: https://somedomain.se/perch/core/settings/diagnostics/
REDIRECT_HANDLER: php5-fcgi
REDIRECT_STATUS: 200
UNIQUE_ID: VzXKdtioh7UAAJMsk98AAABF
SCRIPT_URL: /perch/core/settings/diagnostics/
SCRIPT_URI: https://somedomain.se/perch/core/settings/diagnostics/
HTTP_HOST: some domain.se
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_COOKIE: PHPSESSID=1335cmfm0uhr10qm0aeejo8104; _gauges_unique=1; _gauges_unique_day=1; _gauges_unique_hour=1; _gauges_unique_month=1; _gauges_unique_year=1; cmsa=1; cmssb=0
HTTP_CONNECTION: keep-alive
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/601.5.17 (KHTML, like Gecko) Version/9.1 Safari/601.5.17
HTTP_ACCEPT_LANGUAGE: en-us
HTTP_REFERER: https://somedomain.se/perch/core/settings/diagnostics/
HTTP_DNT: 1
HTTP_X_FORWARDED_FOR: 155.4.14.21
SERVER_SIGNATURE: <address>Apache/2.2.24 (FreeBSD) Server at some domain.se Port 80</address>
SERVER_SOFTWARE: Apache/2.2.24 (FreeBSD)
SERVER_NAME: somedomain.se
SERVER_ADDR: 192.168.4.48
SERVER_PORT: 80
REMOTE_ADDR: 155.4.14.21
DOCUMENT_ROOT: /home/www/vhosts/somedomain.se/htdocs
SERVER_ADMIN: support@someothjer.com
SCRIPT_FILENAME: /home/www/vhosts/somedomain.se/htdocs/perch/core/settings/diagnostics/index.php
REMOTE_PORT: 17580
REDIRECT_QUERY_STRING: extended
REDIRECT_URL: /perch/core/settings/diagnostics/index.php
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
ORIG_SCRIPT_FILENAME: /home/www/vhosts/somedomain.se/php-fpm
ORIG_PATH_INFO: /perch/core/settings/diagnostics/index.php
ORIG_PATH_TRANSLATED: /home/www/vhosts/somedomain.se/htdocs/perch/core/settings/diagnostics/index.php
ORIG_SCRIPT_NAME: /fastcgiphp
PHP_SELF: /perch/core/settings/diagnostics/index.php
REQUEST_TIME: 1463143030
Drew McLellan

Drew McLellan 2638 points
Perch Support

Which version of Perch were you using where that Markdown syntax worked? I can't find a Markdown parser that converts the image when it's placed inside div tags.

The site is created on early Perch 2.4 versions, and the latest update was to 2.4.6 from what I can see in the SQL backup I have.

Drew McLellan

Drew McLellan 2638 points
Perch Support

I can't find a case where that Markdown syntax works. Does the image need to be wrapped in a div?

No, the div is not really necessary per se, it's just used to assign a class for styling. There is no way of assigning a class to the image directly. The only other way I see is to rework the template to include the styling there, but then all images will be styled the same in the text area, no way of individual styling...

Drew McLellan

Drew McLellan 2638 points
Perch Support

You can use the image classes attribute to give a list of class options for the user to apply to an image:

https://docs.grabaperch.com/docs/templates/attributes/type/textarea/

That would still apply one class to all images in the textarea. But then instead perhaps if more images are needed with different styling, we should use multiple items for the content region so they each can have a different class set on them. (Currently it's used to right or left float the image)

Drew McLellan

Drew McLellan 2638 points
Perch Support

No, it gives an option to the user per-image.

How/where would the user apply these classes?

Drew McLellan

Drew McLellan 2638 points
Perch Support

It happens in the image upload dialog box.

Oh sorry, missed the "the user can apply" part of the documentation! Great, that will solve the problem, just need to re-upload the images after I change the template then.