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, Blog, Redactor

perch blog, redactor and image buckets

I'm attempting to add an image to a blog post using redactor which uploads to the resource bucket "blog".

My postDescHTML tag from post.html is:


<perch:blog id="postDescHTML" type="textarea" label="Post" order="3" editor="redactor" html="true" bucket="blog" imagewidth="700" required="true" />

The image successfully uploads to /perch/resources/blog with the original and extra size specified, however it is stuck in the image upload window saying "Loading 100%" in the blog interface and can't be added to the post.

If I remove the bucket attribute then I can add images to the post in redactor without a problem.

Diagnostics:


Perch: 2.5.3, PHP: 5.4.7, MySQL: mysqlnd 5.0.10 - 20111026 - $Id: b0b3b15c693b7f6aeb3aa66b646fee339f175e39 $, with PDO Server OS: WINNT, apache2handler Installed apps: content (2.5.3), assets (2.5.3), perch_blog (4.1), perch_forms (1.7), perch_mailchimp (2.0.1), perch_newsfeed (1), perch_twitter (3.2) App runtimes: <?php $apps_list = array( 'content', 'perch_blog', 'perch_forms', 'perch_mailchimp', 'perch_twitter' ); PERCH_LOGINPATH: /perch PERCH_PATH: C:\Users\Tom\Dropbox\Sites\cbedford.com\perch PERCH_CORE: C:\Users\Tom\Dropbox\Sites\cbedford.com\perch\core PERCH_RESFILEPATH: C:\Users\Tom\Dropbox\Sites\cbedford.com\perch\resources Image manipulation: GD PHP limits: Max upload 30M, Max POST 8M, Memory: 128M, Total max file upload: 8M Resource folder writeable: Yes HTTP_HOST: cbedford.localhost DOCUMENT_ROOT: C:/Users/Tom/Dropbox/Sites/cbedford.com REQUEST_URI: /perch/core/settings/diagnostics/ SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Tom Bedford

Tom Bedford 3 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Does the bucket exist, and is it writable?

Yes, when chosen in redactor the images are uploaded to the bucket - they appear in the folder /perch/resources/blog/ after adding them. The problem is redactor seems to get stuck after the upload (the "loading 100%" screen) and doesn't put them in the post. I can use them by manually writing out an image tag linking to "/perch/resources/blog/image.jpg" in the redactor source view.

I use the same bucket for the main blog post image which works as expected with:

<perch:blog type="image" id="image" label="Image" width="700" bucket="blog" order="2" />
Drew McLellan

Drew McLellan 2638 points
Perch Support

That's very odd. Do you get any errors in the browser console?

Yes! direct image link

pasted:

Uncaught SyntaxError: Unexpected token v jquery-1.11.1.min.js:4
m.parseJSON jquery-1.11.1.min.js:4
e.parseJSON jquery-1.11.1.min.js:7
(anonymous function) VM83:1
m.isFunction.e jquery-1.11.1.min.js:2
j jquery-1.11.1.min.js:2
k.fireWith jquery-1.11.1.min.js:2
x jquery-1.11.1.min.js:4
b jquery-1.11.1.min.js:4

I don't know if this gives you anything more helpful to go on - direct image link

Drew McLellan

Drew McLellan 2638 points
Perch Support

Hmm, ok, thanks. Are you on the most recent version of the Redactor plugin from our site? I'll see if I can reproduce this.

Yes, I did just re-download the plugin and replace it to make sure - same result.

If your reproducing my full post.html template is:


<div class="hentry"> <h1><a href="<perch:blog id="postURL" type="hidden" />" rel="bookmark" class="entry-title"><perch:blog id="postTitle" type="text" label="Title" required="true" size="xl autowidth" order="1" /></a></h1> <p class="entry-published date"> <perch:blog id="postDateTime" type="date" label="Date" time="true" format="%d %B %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 type="image" id="image" label="Image" width="700" bucket="blog" order="2" />" alt="<perch:blog id="postTitle" />" /> </div> </perch:if> <div class="description entry-content"> <perch:blog id="postDescHTML" type="textarea" label="Post" order="3" editor="redactor" html="true" imagewidth="700" bucket="blog" required="true" /> </div> </div>
Drew McLellan

Drew McLellan 2638 points
Perch Support

Thanks