Problems, need help? Have a tip or advice? Post it here.
9 posts Page 1 of 1
Browsers: Firefox 5.x, Firefox 6.x, Chrome 12, IE9
OS: Arch Linux, Windows 7

Server: Ubuntu Server 10.10, amazon EC2 micro instance, apache 2, PHP 5.3
Couch version: 1.1, upgraded from 1.01, free edition

Issue:
The preview lightbox launched with the "View Image" button launches, but is empty, in Firefox & Chrome; in IE9, the lightbox does not open at all and I'm taken directly to the image URL. Upon clicking in Firefox, firebug reports the error "Undefined can't be converted to object", mootools.js, line 279 (pretty useless, I know). This feature used to work for me in 1.01.

Furthermore thumbnail generation is not working at all. I'm not sure how it's supposed to behave since I hadn't tried the thumbnail feature until now, but thumbnails do not show up in the admin area before or after selecting an image and saving the page. Calling them with <cms:show image_thumb /> produces an empty string, although calling the original image seems to work fine. Here's my template configuration for the page:

Code: Select all
   <cms:template clonable="1" title="Our Photos">
      <cms:editable name="image" label="Image" type="group" />
         <cms:editable
            name="image_full"
            label="Upload Image"
            type='image'
            group='image' 
            width="800"
            height="600"
            crop="1"
         />
         <cms:editable
            name="image_thumb"
            label="Image Thumbnail"
            type='thumbnail'
            group='image' 
            width="120"
            height="90"
            crop="1"
         />
         <cms:editable
            name="image_caption"
            label="Caption"
            type="text"
          />   
   </cms:template>


I thought this might be related to requiring GD to process images, but I verified that I have it installed and enabled (using phpinfo()). So unless you use ImageMagick, that shouldn't be the issue (and if you do, let me know and I'll check whether it's installed). I then considered the possibility that it was a folder permission issue, but even setting www-data:www-data (the user/group for apache2 on ubuntu server) and 777 on couch/uploads/ and its subfolders didn't change anything (are the generated thumbs and cropped versions stored elsewhere? I don't know).

I'm not sure what the mootools bug is or if/how it's related (could be failing to find the image it's looking for?). I did notice the mootools version is a little out of date (1.2.0 vs. 1.2.5 current 1.2.x release or 1.3.2 most up-to-date release on the website). I know from experience mootools tends to break its API with updates though, so I didn't update it myself, not knowing what dependencies couch might have.

Anyway hopefully that's enough info for you to get an idea of what's going on. Let me know if you need anything. The site isn't complete so I'd rather not share a link publicly, but I can get you one via PM and/or set you up with a couch user or (limited) ssh account if you need (I know it's a free version so I'm not entitled to support or anything, but I'm happy to help you track down the issue).

Oh, also, in an unrelated bug, putting a richtext field inside of a group results in the rich text editor being partially cut off in the admin area (it doesn't fit inside the field group wrapper). This is a minor annoyance that can be circumvented by just removing the richtext field from the group, but I did notice it and figured you might care to take a look. :)
Hi and welcome to our forums.

The thumbnail issue is a known bug in the current release of Couch. You can find a patch for it here - viewtopic.php?f=4&t=1507&p=2265&hilit=thumbnail+patch#p2265
Please apply it and that should solve the thumbnail problem.

Regarding the lightbox issue - that is intriguing.
Could you PM me your site's FTP as well as Couch's admin credentials please?
I'd like to take a closer look.

Thanks.
Thanks! I'll apply the patch. And yes, I'll get you login details if the preview issue persists. Probably won't get back to you on it till tomorrow. Thanks for the help.
Hi nphyx,

OK .. we were able to reproduce that image preview problem.
It appears to affect only the very latest browsers which seem no longer to be 100% compatible with the version of mootools used with Couch.
Switching to the latest version of Mootools 1.3.2 seems to resolve the problem.

Please try replacing the original mootools.js with the one I am attaching (you might have to clear your browser's cache for the newer version to be picked up) and let us know if this helps.

Thanks

Attachments

Hi, thanks! Sorry I didn't get back to you earlier, I had some unexpected things come up at the day job that have been sucking up extra time (this couchcms site is a side project). The mootools update fixed the lightbox problem, but I'm still haviing issues with the thumbnail generator. Once I added the updated ajax.php from the above-linked thread the "image thumbnail (will be created automatically)" line showed up, but with nothing underneath (after uploading a new image and selecting it, as well as on save).

I poked around a bit and found there were a couple elements with visibility:hidden applied as inline styles, so I removed that inline style (using firebug) and the expected fields showed up with the recreate button, select dropdown for cropping, and "View Thumbnail" link. Clicking "recreate" gives me a "thumbnail recreated" alert but nothing else seems to happen. It did send an ajax POST which returned "Ok" (plain text), here's the request params, if this helps:

Code: Select all
act   crop
cp   middle
nonce   8d395ba5734e186b5c0c33d1e3bfe193
p   26
tb   image_thumb
tpl   14


I'm not sure what this is supposed to look like or do so if all of this is irrelevant, my apologies.

Clicking the view thumbnail link results in a lightbox with a spinner inside but it never loads the image (the spinner stays up indefinitely).

Let me know if you want to come check it out, or if I'm doing something obvious wrong.
Hi,

You forgot to associate the thumbnail with an existing 'image' editable region and hence the problem.

Please modify your thumbnail definition to follows -
Code: Select all
<cms:editable
            name="image_thumb"
            label="Image Thumbnail"
            type='thumbnail'
            group='image'
            width="120"
            height="90"
            crop="1"
            show_preview='1'
            assoc_field='image_full'
         />

I have added these two lines to your original code -
Code: Select all
            show_preview='1'
            assoc_field='image_full'

- where 'image_full' is the name of the 'image' field the thumbnail should be created from.
This should make the thumbnail work.
Please let me know.
Thanks
Ok, that's got me closer. Now I have the image icon as expected, but the lightbox that appears when I click on the icon still displays the spinner indefinitely (as described above).
Could you please try selecting a new image in the image type editable region that the thumbnail is associated with?
Saving the page should now create (and also show a preview) of the thumbnail instead of the icon. Clicking on the thumbnail preview should open up the thumbnail in a lightbox.

The idea here is to change the main image thus causing Couch to refresh the associated thumbnail as well.

Please let me know if this helps.
Thanks.
Ok, after changing the image, saving and returning to the editor it seems to be working as expected. Thanks for your help :)
9 posts Page 1 of 1

Who is online

In total there are 3 users online :: 0 registered, 0 hidden and 3 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 3 guests