Forum

Thread tagged as: Problem, Addons, Blog

Blog post images

Good morning,

I'm not sure if it's already reported (I couldn't find it in the forum) but we can't seem to add images (or files) through Redactor, inside the blog after the latest blog update. The sites we have running Blog 5.6.1 all have this issue and all the other software is up-to-date too. Problem happens in Safari and Chrome (MacOS Sierra). Is there a work around or is the bug likely to be hoovered up soon?

Diagnostic below:

Perch: 3.0.10, PHP: 7.1.7-1+ubuntu16.04.1+deb.sury.org+1, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $, with PDO
Server OS: Linux, fpm-fcgi
Installed apps: content (3.0.10), assets (3.0.10), categories (3.0.10), root_analytics (2.0.0), perch_blog (5.6.1), perch_forms (1.9), root_heartbeat (1.0.1), redfinch_optim (1.0)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_forms', 'root_analytics' );
PERCH_LOGINPATH: /admin
PERCH_PATH: /home/forge/amberol.co.uk/build/admin
PERCH_CORE: /home/forge/amberol.co.uk/build/admin/core
PERCH_RESFILEPATH: /home/forge/amberol.co.uk/build/admin/resources
Image manipulation: GD Imagick
PHP limits: Max upload 32M, Max POST 32M, Memory: 512M, Total max file upload: 32M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
HTTP_HOST: amberol.co.uk
DOCUMENT_ROOT: /home/forge/amberol.co.uk/build
REQUEST_URI: /admin/core/settings/diagnostics/
SCRIPT_NAME: /admin/core/settings/diagnostics/index.php

Thanks, Lea.

Lea Chapman

Lea Chapman 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

When you say you can't add files, what are you seeing?

Nothing at all, so when you click either the image or the file button in Redactor nothing happens, no console errors.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you show me your template? Do you have any popup or ad blockers installed?

Ryan Gittings

Ryan Gittings 1 points
Registered Developer

Have you recently updated Perch? I found I had this issue until I cleared cache after upgrading to latest Perch build for some reason, really weird.

Thanks Ryan - I've cleared cache and cookies etc. It's only happening on sites with blog 5.6.1.

This is a quick video of it happening: https://www.dropbox.com/s/mnh1gqj60lyz6cd/redactor-bug.mov?dl=0

This is the template code:


<h1> <perch:blog id="postTitle" type="text" label="Title" required="true" size="xl autowidth" order="1" /> </h1> <span class="post-meta"> Posted <time datetime="<perch:blog id="postDateTime" type="date" label="Date" time="true" format="Y-m-d H:i:s" divider-before="Meta information" />"><perch:blog id="postDateTime" type="date" time="true" format="%d/%m/%Y" /></time> in <perch:categories id="categories" set="blog" label="Categories" display-as="checkboxes"> <a href="/community/category/<perch:category id="catSlug" type="slug" />" class="p-category"> <perch:category id="catTitle" type="text" /><perch:if exists="perch_item_last"><perch:else />, </perch:if> </a> </perch:categories> </span> <perch:if exists="image"> <img data-src="<perch:blog id="image" type="image" width="740" height="540" crop="true" label="Image" order="4" bucket="Community" divider-before="Media" />" alt="<perch:blog id="postTitle" />" /> <noscript> <img src="<perch:blog id="image" type="image" width="740" height="540" crop="true" label="Image" order="4" bucket="Community" divider-before="Media" />" alt="<perch:blog id="postTitle" />" /> </noscript> </perch:if> <perch:blog id="postDescHTML" type="textarea" label="Post" order="3" editor="redactor" html="true" size="xxl autowidth" /> <perch:blog id="social" type="checkbox" label="Show social media buttons" value="1" suppress="true" divider-before="Social Media" /> <perch:blog id="discuss" type="text" label="Icon introduction" suppress="true" default="Join us for a chat online" size="m" help="Add a small snippet of text to introduce the social media icons" /> <perch:if id="social" value="1"> <div class="discuss"> <span class="discuss__title"><perch:blog id="discuss" type="text" /></span> <div class="discuss__links"> <perch:layout path="social-links" /> </div> </div> </perch:if> <perch:blog id="excerpt" type="textarea" label="Excerpt" order="2" suppress="true" size="s" /> <perch:blog id="image" type="image" width="280" height="250" crop="true" suppress="true" bucket="Community" />

Can I ask if we got any further with this one?

Drew McLellan

Drew McLellan 2638 points
Perch Support

I've not been able to reproduce that, no.

Well we did some more of our own digging. First off, it seems related to this issue: https://forum.grabaperch.com/forum/09-22-2017-problems-with-assets-perch-3010

Doing some further investigating in our code we found this error related to core:

Notice: Undefined index: bucket in /home/forge/amberol.co.uk/build/admin/core/apps/assets/async/get-assets/index.php on line 56
{"assets":[]}

The request made: https://amberol.co.uk/admin/core/apps/assets/async/get-assets/?page=1&v=3.0.10&field=perch_5_text&type=img&_=1508229516634

So, looks like if you don't set a bucket for the Redactor image/file assets then it doesn't work. As far as we can tell this was working in 3.0.8 (we cannot confirm 3.0.9 as it didn't crop up) but it's definitely not functioning in 3.0.10.

How would you recommend we fix the issue?

A further note on this, we've been uploading assets in the main Assets panel and then adding them manually for now:

Inline Assets

The reason we can't just add a bucket to the editor is that this was an old upgraded site...

Drew McLellan

Drew McLellan 2638 points
Perch Support

The reason we can't just add a bucket to the editor is that this was an old upgraded site...

I don't follow the logic here. What's stopping you?

I guess I worded it wrongly - I'd rather not have to go through every Redactor instance and change the default bucket - we'll have some inline assets in the default resources folder and then some in a bucket, which is a bit disjointed. Are you likely to keep the requirement for a bucket or is it something you'll change in a future release? I can then decide what's best to do.

Aha, following this advice (setting the bucket to 'default') has fixed it: https://forum.grabaperch.com/forum/10-18-2017-v3-editor-woes