21 replies [Last post]
Shai's picture
Offline
Joined: 03/06/2008
Juice: 36

I'm using the latest (D6) stable versions of Ubercart, Imagefield, and Lightbox2.

The title text and alt fields are enabled in the image field. They are being saved to the db. But the drupal is spitting out html with
alt="" title=""

What's particularly annoying, is that Lightbox2 proclaims to have a feature just for this situation. It says that it will put the contents of your node title into the modal captions if it can't find an alt or title tag contents. But... no luck there. Empty captions in the Lightbox2 modal display.

Ideas?

Thanks much.

Shai

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15422
Re: Can't Get Titles from Imagefield to Display

Hmm... someone else just raised this issue as well, and I wonder if it has anything to do with our automatic setup of that imagefield. Puzzled I bookmarked the issue to see if Lyle can investigate tomorrow and can get back to ya then.

Shai's picture
Offline
Joined: 03/06/2008
Juice: 36
What Happens After Ubercart's Script for Setting Up Imagefield

Ryan,

Thanks so much!

Via the normal CCK, manage fields at:

/admin/content/node-type/product/fields/field_image_cache

everything looks right.

This certainly isn't an emergency. Again thanks much.

Shai

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6841
Re: What Happens After Ubercart's Script for Setting Up Imagefie

I think Imagefield changed where it was loading the descriptive data, so Ubercart was looking in the wrong place. Here's a patch to make it look in the right place.

AttachmentSize
image_alt_title.patch 3.08 KB
Shai's picture
Offline
Joined: 03/06/2008
Juice: 36
Title problem fixed, but now call to undefined function

Hi Lyle,

That seemed to take care of the title problem. Now, however I'm getting a call to undefined function fatal error:

Fatal error: Call to undefined function dpm() in /public_html/sites/all/modules/ubercart/uc_product/uc_product.module on line 736

Thanks. When you post the patch, make sure to tell me which version of the module I should apply it against.

Thanks,

Shai

RickA's picture
Offline
Joined: 02/03/2009
Juice: 71
Re: Re: What Happens After Ubercart's Script for Setting Up Imag

Thanks for the quick response to this problem. I have made the changes in the patch file and I'm getting an error message:

Fatal error: Call to undefined function dpm() in /home/soblures/public_html/drupal6/sites/all/modules/ubercart/uc_product/uc_product.module on line 739

The following is copied from my patched uc_product.module file. I have added the two line numbers below (only here) for reference.

  if (module_exists('imagecache') && ($field = variable_get('uc_image_'. $node->type, '')) && isset($node->$field) && file_exists($node->{$field}[0]['filepath'])) {
739     dpm($field);
740     dpm($node->$field); 
    $node->content['image'] = array('#value' => theme('uc_product_image', $node->$field, $teaser, $page),
      '#access' => $enabled['image'],
      '#weight' => $weight['image'],
    );
Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15422
Re: Re: Re: What Happens After Ubercart's Script for Setting Up

That's just a relic in from when he was testing the fix... you can just take out the lines:

+    dpm($field);
+    dpm($node->$field);

either from the patch before you apply it or from your uc_product.module after you apply it.

Shai's picture
Offline
Joined: 03/06/2008
Juice: 36
Thanks -- How best to follow new commits?

Perfect.

Now that I'm on the bleeding edge with a patched version of the latest Head version from here Smiling -- what is the best way for me to follow the committed patches/release notes to decide whether I should upgrade.

I've got this on a production site now, or almost production... though it is a site with very little initial traffic.

Thanks,

Shai

RickA's picture
Offline
Joined: 02/03/2009
Juice: 71
Re: Re: Re: Re: What Happens After Ubercart's Script for Setting

I am a newbie to patch files. I was too embarrassed to ask so I applied each line into the product module file manually. Smiling I have checked them and they look perfect.

I removed the two "dpm" lines. The error message is gone and I am getting the "Title" on mouseover of the product image. I am also now getting the "Title" as a caption in the flash window but, unfortunately, no flash image. There is a diamond shaped frame with a camera icon and an diagonal line across the camera.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15422
Re: Re: Re: Re: Re: What Happens After Ubercart's Script for Set

@Shai - unless another bugfix comes up that is very specific to you, I'd say you'll be alright until we push the changes out to a beta4. Lyle periodically updates CVS HEAD with changes from our Bazaar repository, and those will show up as dev releases. We can start doing that more regularly if need be, but I don't think it's been much of an issue.

@RickA - what you're seeing in the popup is actually controlled by Javascript. It's odd that the image wouldn't display properly now. Do you have a URL you can point us to?

RickA's picture
Offline
Joined: 02/03/2009
Juice: 71
Re: Re: Re: Re: Re: Re: What Happens After Ubercart's Script for

The only way to see the store is to change your hosts file and use the IP since DNS is not pointing there yet. Let me know if you want to do that.

The popup image was working until I applied the fix just no titles. Now the titles are OK but the popup has no image.

Here's what it look like. Will that help?

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15422
Re: Re: Re: Re: Re: Re: Re: What Happens After Ubercart's Script

Hmm... can you post up the HTML source for the images from your product page? Then we can see what it's trying to link to... that's what affects the image in the Lightbox.

RickA's picture
Offline
Joined: 02/03/2009
Juice: 71
Re: Re: Re: Re: Re: Re: Re: Re: What Happens After Ubercart's Sc

http://soblures.com/drupal6/sites/default/files/imagecache/product_full/...

And I put that address into my browser and there is nothing there.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15422
Re: Re: Re: Re: Re: Re: Re: Re: Re: What Happens After Ubercart'

Might try flushing your image cache presets through the ImageCache UI.

RickA's picture
Offline
Joined: 02/03/2009
Juice: 71
Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: What Happens After Uberc

Flushed all caches at http://soblures.com/drupal6/admin/build/imagecache

No change.

Would it make sense to copy over the original (uncorrected) uc_product.module file and start over?

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15422
Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: What Happens After U

Hmm.. actually, maybe you just don't have a product_full preset. Can you look in your ImageCache UI and see?

RickA's picture
Offline
Joined: 02/03/2009
Juice: 71
Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: What Happens Aft

I created a product_full preset and...it works!

Thanks so much!!!!

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15422
Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: What Happens

No problem. I think Lyle added that in via an update function in a separate patch that hasn't been pushed into the betas yet. Might need to do a beta4 sooner than I thought. Sticking out tongue

Pogle's picture
Offline
Joined: 02/12/2009
Juice: 27
Nearly...

OK, this is my first ever patch! so like RickA I pasted the lines in manually. The images now have alt text but ThickBox doesn't work - the screen greys out and the loading bar appears but it just hangs there. (I rolled back did it again to make sure.)

Now I noticed lines 26-29 of the patch don't actually match my original uc_product.module.

   // Get the current product image widget.
   $image_widget = uc_product_get_image_widget();
   $image_widget_func = $image_widget['callback'];
-  $image_defaults = array('filepath' => '','alt' => '','title' => '');

-  $first = array_merge($image_defaults, array_shift($images));
+  $first = array_shift($images);

Basically it's like that change has already been made - the two lines to take out don't exist and the line to put in is already there. So I wonder if the patch is vaild for me. I'm using Ubercart 2.0 beta3 which I think was the latest at the time the patch was posted. The thread originator said 'D6' so I assume this is for UC 2 (?).

Any suggestions please? Sorry, I'm very new to this.

adrianf25's picture
Offline
Joined: 03/14/2010
Juice: 11
Re: Nearly...

In ubercart 6.x-2.2

ALT and title attributes are always gaps within the img element (which has class="imagecache imagecache-product")

<img height="100" width="70" class="imagecache imagecache-product" title="" alt="" src="">

In ubercart/uc_product/uc_product.module remplace

in line 1325
$data['image'] = array('#value' => l(theme('imagecache', 'product_list', $image['filepath'], $image['alt'], $image['title']), 'node/'. $node->nid, array('html' => TRUE)));
for
$data['image'] = array('#value' => l(theme('imagecache', 'product_list', $image['filepath'], $image['data']['alt'], $image['data']['title']), 'node/'. $node->nid, array('html' => TRUE)));

In line 1592
$output .= theme('imagecache', 'product', $first['filepath'], $first['alt'], $first['title']);
for
$output .= theme('imagecache', 'product', $first['filepath'], $first['data']['alt'], $first['data']['title']);

in line 1604
$output .= theme('imagecache', 'uc_thumbnail', $thumbnail['filepath'], $thumbnail['alt'], $thumbnail['title']);
for
$output .= theme('imagecache', 'uc_thumbnail', $thumbnail['filepath'], $thumbnail['data']['alt'], $thumbnail['data']['title']);

Also if you want that you can use PHP 5.3 (this is not implemented in the file patch)

line 819
function uc_product_form_alter(&$form, &$form_state, $form_id) {
for
function uc_product_form_alter($form, $form_state, $form_id) {

AttachmentSize
uc_product.module.patch 1.68 KB
lesliewu's picture
Offline
Joined: 09/05/2009
Juice: 41
Hi, I followed the

Hi,

I followed the instructions and refreshed all cache but I still get alt="" and title="". What else can I try?

Thank you.

Buro Friesen's picture
Offline
Joined: 10/10/2011
Juice: 10
Fixed??

Did you find a fix for the problem?