Forum

Thread tagged as: Problem, Redactor

Textarea bucket not respected with redactor

I've got a content template with a textarea which defines a bucket:

<perch:content id="inhoud" type="textarea" label="Inhoud" html="true" editor="redactor" bucket="overige"/>

Uploading works fine, but it puts the uploads in the main resources folder not in the specified bucket. Changing the content template to use markitup like:

<perch:content id="inhoud" type="textarea" label="Inhoud" html="true" editor="markitup" bucket="overige"/>

And the bucket is respected.

According to the docs you should be to use buckets on textarea's (https://docs.grabaperch.com/docs/templates/attributes/type/textarea/) and there's no comment that this doesn't apply for redactor so i'm guessing this is a bug?

Benjamin Verkleij

Benjamin Verkleij 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you show us your diagnostics report?


Perch: 2.7.4, PHP: 5.5.19, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: bf9ad53b11c9a57efdb1057292d73b928b8c5c77 $, with PDO Server OS: Linux, apache2handler Installed apps: content (2.7.4), assets (2.7.4), categories (2.7.4), perch_forms (1.8.2) App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_forms' ); PERCH_LOGINPATH: /mycms PERCH_PATH: /home/****/public_html/mycms PERCH_CORE: /home/****/public_html/mycms/core PERCH_RESFILEPATH: /home/****/public_html/images Image manipulation: GD Imagick PHP limits: Max upload 20M, Max POST 8M, Memory: 256M, Total max file upload: 8M Resource folder writeable: Yes HTTP_HOST: **** DOCUMENT_ROOT: /home/****/public_html REQUEST_URI: /****/core/settings/diagnostics/ SCRIPT_NAME: /****/core/settings/diagnostics/index.php
Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you successfully uploading files into the bucket from other templates?

Yes, no problems then (when not using a redactor textarea)

Drew McLellan

Drew McLellan 2638 points
Perch Support

I'll have to look into it. Are you on the latest version of the Redactor plugin from our site?

Drew McLellan

Drew McLellan 2638 points
Perch Support

And does it work with the default bucket ok?

yeah the default bucket works fine, it just looks like redactor completely ignores the bucket when you specify one.

Yes the latest redactor plugin (downloaded today).

Drew McLellan

Drew McLellan 2638 points
Perch Support

That's odd. I'll have to get it set up and try it out.

redactor seems to have changed the options, so in _config.inc file change:

        self.redactor({  
            imageUpload: 'PERCH_LOGINPATH/addons/plugins/editors/redactor/perch/upload.php?filetype=image',
            fileUpload: 'PERCH_LOGINPATH/addons/plugins/editors/redactor/perch/upload.php',
            uploadFields: {
                'width'  :  self.attr('data-width')||'',
                'height' :  self.attr('data-height')||'',
                'crop'   :  self.attr('data-crop')||'',
                'quality':  self.attr('data-quality')||'',
                'sharpen':  self.attr('data-sharpen')||'',
                'density':  self.attr('data-density')||'',
                'bucket' :  self.attr('data-bucket')||'default'
            }
        });

to:

        self.redactor({  
            imageUpload: 'PERCH_LOGINPATH/addons/plugins/editors/redactor/perch/upload.php?filetype=image',
            fileUpload: 'PERCH_LOGINPATH/addons/plugins/editors/redactor/perch/upload.php',
            uploadImageFields: {
                'width'  :  self.attr('data-width')||'',
                'height' :  self.attr('data-height')||'',
                'crop'   :  self.attr('data-crop')||'',
                'quality':  self.attr('data-quality')||'',
                'sharpen':  self.attr('data-sharpen')||'',
                'density':  self.attr('data-density')||'',
                'bucket' :  self.attr('data-bucket')||'default'
            },
            uploadFileFields: {
                'bucket': self.attr('data-bucket')||'default'
            }
        });
    });