Forum

Thread tagged as: Problem, Error

Problem uploading images through textarea editor

Hello, for some reason I can't upload images through a textarea editor. I am able to upload images using Assets and with a Image field in a template, but just not in a textarea field. Any idea what I might be doing wrong?

This is my template code:

<perch:if exists="infoHeading">
    <h2><perch:content id="infoHeading" type="text" label="Heading" title="true" required="true" /></h2>
    <div class="infoContent-region">
    <perch:content id="infoContent" type="textarea" label="Content" editor="markitup" textile="true" imagewidth="325" imagecrop="true" bucket="Content Media" />
    </div>
</perch:if>

Once I choose my file and click on upload, the dialogue box turns red. I have no idea what this means.

Red dialogue box upload error

Any guidance is appreciated...thanks!

Joshua Rodriguez

Joshua Rodriguez 2 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

That dialog is a strange colour. Have you made changes to it? If so, try replacing with the stock version.

Hi Drew,

It starts out as a gray dialog box, but after I choose a file and click on Upload, the box changes to red and nothing else happens.

I'm using Perch 2.5.4 and no I haven't made any changes to any of the default files or settings, except for replacing the markitup folder that's under perch ("cms" in my case) > addons > plugins > editors, with the folder included in the Perch 2.5.4 download.

I inspected the Upload button and noticed a class of "fail" was added to the form...removing it removed the red, so I at least know where the color is coming from, just not why the error. Notice the gray-highlight in developer tools:

Class added to dialog box

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ah, ok, great.

Which browser are you using?

I'm using the latest version of Chrome...but I also tried in Firefox, Safari, and Explorer and got the same result.

For what it's worth, the Redactor Editor allows you to drag n drop images into a textarea, a process our editors find much more handy than specifying a filename

Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you get any output in the browser console?

No, I'm not seeing any output in the browser console Drew.

Stefan thanks ...I'll have to give Redactor a try too. I could see how that would simplify things.

Drew,

Just wanted to confirm that this is another Windows OS issue. After uploading the website to the live server, I am able to upload images through any editor, including markitup.

When I upload images through the editor, are they suppose to be added to my Assets? Because the images I uploaded through the editor display fine on the website, but I don't see them in the Assets app.

Just want to be sure this is normal.

Thanks

Drew McLellan

Drew McLellan 2638 points
Perch Support

Through MarkItUp, yes. Be sure you're on the latest version.

Drew, I think I spoke too soon.

The version of markitup I am using is the version that is included with Perch 2.5.4. Not sure if that is the latest version of markitup...?

I tried to upload an image through markitup on the live server and the first time I click on the image icon in markitup, nothing happens, but I get the following in the console.

Console Errors 1

...and if I click on the image icon again in markitup my browser window goes blank and I get the following added in the console.

Console Errors 1

My template hasn't changed. I was able to upload images fine with redactor...but I would like the uploaded images to be added to the Assets App, so I prefer to use markitup. Any ideas?

Thanks

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Is there anything else you can tell us about your setup? Have you added any additional JavaScript via a UI plugin for example?

When you get a "blank" browser window is this a PHP error causing no output to be sent to the browser? If so what is the actual error in the PHP error log?

This isn't something we are seeing generally, MarkItUp is the default editor so if it just didn't work we'd have a lot of identical reports. We need to figure out what is different in your case.

Hi Rachel,

I tried uploading an image through MarkItUp again and checked my PHP error log, but no errors there. This is my diagnostics report, hopefully this helps. I can't think of any other information, regarding my setup, that would be helpful.

I tried using redactor and ckeditor, and both upload the same image with no problem...but I would prefer to use MarkItUp on this project.

If there's anything else you can think of please let me know.

Thank you!

Diagnostics report HEALTH CHECK

Perch is up to date PHP 5.3.6 version is okay, but a little out of date. Consider updating soon. MySQL 5.1.55 is up to date Image processing available Memory limit is low. Memory use is limited to 20M, which could cause problems manipulating large images.

SUMMARY INFORMATION

Perch: 2.5.4, PHP: 5.3.6, MySQL: 5.1.55, with PDO Server OS: FreeBSD, cgi-fcgi Installed apps: content (2.5.4), assets (2.5.4), perch_blog (4.1), perch_mailchimp (2.0.1), perch_shop_paypal (1.2.1), perch_comments (1.1) App runtimes: <?php $apps_list = array( 'content', 'perch_shop_paypal', 'perch_comments', 'perch_blog', 'perch_mailchimp' ); PERCH_LOGINPATH: /cms PERCH_PATH: /cms PERCH_CORE: /cms/core PERCH_RESFILEPATH: /cms/resources Image manipulation: GD PHP limits: Max upload 50M, Max POST 50M, Memory: 20M, Total max file upload: 20M Resource folder writeable: Yes DOCUMENT_ROOT: / HTTP_HOST: greaterwksmin.com REQUEST_URI: /cms/core/settings/diagnostics/ SCRIPT_NAME: /cms/core/settings/diagnostics/index.php

Drew McLellan

Drew McLellan 2638 points
Perch Support

Does geovisit mean anything to you? It's not part of Perch, and I think it might be throwing errors that are then causing the Perch code problems.

Drew I believe its a javascript plugin for site analytics.

My client's using yahoo web hosting and it seems to be part of a script for yahoo's analytics app. I went ahead and removed the script from all the pages since I already setup google analytics for my client, but I'm still seeing the same geovisit undefined error. So I'm currently contacting yahoo webhosting to find out how to remove or disable the feature.

Hopefully this will resolve the issue, but I will keep you posted to any changes or updates.

Thanks

Joshua, try uploading an image after removing bucket="Content Media" from the your template. If it works, check your buckets.php config and see if the path is defined correctly.

Drew,

I successfully disabled the yahoo analytics app and you were right Drew. The upload dialog now comes up, but I was having the same problem that I previously had during development...that my image was failing to upload and the dialog would turn red.

I removed bucket="Content Media" from my template, like Andres suggested (thank you!), and I was able to upload my images fine. So where do I go from here if I want to place all images that are uploaded through any editor in a bucket? I could not locate or maybe haven't added a buckets.php file in my config folder, so how can I check for any path errors?

Thanks

Drew McLellan

Drew McLellan 2638 points
Perch Support

Content Media isn't a safe bucket name. Name it like you would a folder - lowercase, no spaces, less than 16 chars.

Drew,

I changed the bucket to `infomedia', refreshed everything and tried again, but I still got a red dialog and wasn't able to upload an image.

However, I was able to get everything to work as expected by manually adding my 'infomedia' folder to my resources directory. I can now upload images, using MarkItUp, to a bucket.

Is MarkItUp supposed to create a directory if it doesn't exist already or do I need to manually add a bucket when I use MarkItUp?

I appreciate all your help Drew.

Drew McLellan

Drew McLellan 2638 points
Perch Support

In theory it should be created by the current version of the upload script included with MarkItUp. There are cases where this could fail - e.g. permissions.