Hello,
I have a field for pictures, by imagefield module. I tune output for the that field through imagecache preset with link to the node - "preset_name field linked to node". And I get something like this for <a> tag:
<a alt="<img src="http://newintecco.andy/sites/newintecco.andy/files/imagecache/offerpicture/offers/b_1.jpg" alt="" title="" class="imagecache imagecache-offerpicture imagecache-default imagecache-offerpicture_default" width="180" height="120" />" title="<img src="http://newintecco.andy/sites/newintecco.andy/files/imagecache/offerpicture/offers/b_1.jpg" alt="" title="" class="imagecache imagecache-offerpicture imagecache-default imagecache-offerpicture_default" width="180" height="120" />" href="/node/55">
This happened after update Views from 2.5 to 2.6, so I think this is a Views bug, not ImageField. All other configurations on my site not change, and this error was appeared.
May be that problem linked with this issue - alt attribute set for node fields rendered as link produces not compliant HTML, because I solve it by the same way:
before my changes, file views_handler_field.inc, lines start from 517:
$alt = $this->options['alter']['alt'];
$alt = strtr($alt, $tokens);
if ($alt) {
$options['attributes']['title'] = $alt;
$options['attributes']['alt'] = $alt;
}
after my changes:
$alt = $this->options['alter']['alt'];
$alt = strtr($alt, $tokens);
if ($alt) {
}
Yearh, this is "quick and dirty", but we have this problems on a production site, so the speed of solving the problem was unvalueable and had highest priority.
Please, fix this bug...
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 2009-06-19_153558.jpg | 70.81 KB | andyceo |
Comments
Comment #1
andyceo commentedPS: Yes, I clear cache and the problem is still exists.
Comment #2
fenstratThis looks like an issue I've come across.
Think you'll find this is as a result of having your image field double linked. Check your image field settings in the view, make sure "Link this field to its node" is unchecked and Format is "Image linked to node" - i.e. make sure there is only one link.
If both the format and link to node are set to output a link then basically the double link is rendered.
Comment #3
andyceo commentedThank your for replay!
Yes, I was wrong a little.
I have this settings (see attached file below).
So, I choose Views's "Link this field to its node" and imagecache's "presetname image", not "prestname image linked to node" as I said before. Sorry.
And the full html output for that field is:
As we see, the "alt" and "title" attributes are wrong.
Comment #4
merlinofchaos commentedPlease don't duplicate issues you're already participating in. If the same patch solves the issue, what's the point of adding EVEN MORE traffic to this issue queue? Gah.
http://drupal.org/node/489888
Comment #5
glynster commentedThis worked a treat and resolved the duplicate and bash created in the title and alt tags. Thanks a bunch.
Comment #6
raphael apard commentedI fixed this issue by updating filefield-6.x-3.6 to filefield-6.x-3.7.