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="&lt;img src=&quot;http://newintecco.andy/sites/newintecco.andy/files/imagecache/offerpicture/offers/b_1.jpg&quot; alt=&quot;&quot; title=&quot;&quot; class=&quot;imagecache imagecache-offerpicture imagecache-default imagecache-offerpicture_default&quot; width=&quot;180&quot; height=&quot;120&quot; /&gt;" title="&lt;img src=&quot;http://newintecco.andy/sites/newintecco.andy/files/imagecache/offerpicture/offers/b_1.jpg&quot; alt=&quot;&quot; title=&quot;&quot; class=&quot;imagecache imagecache-offerpicture imagecache-default imagecache-offerpicture_default&quot; width=&quot;180&quot; height=&quot;120&quot; /&gt;" 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...

CommentFileSizeAuthor
#3 2009-06-19_153558.jpg70.81 KBandyceo

Comments

andyceo’s picture

PS: Yes, I clear cache and the problem is still exists.

fenstrat’s picture

This 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.

andyceo’s picture

StatusFileSize
new70.81 KB

Thank 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:

<div class="views-field-field-offerpicture-fid">
<span class="field-content">
<a alt="&lt;img src=&quot;http://newintecco.andy/sites/newintecco.andy/files/imagecache/offerpicture/offers/b_2_0.jpg&quot; alt=&quot;&quot; title=&quot;акция&quot; class=&quot;imagecache imagecache-offerpicture imagecache-default imagecache-offerpicture_default&quot; width=&quot;180&quot; height=&quot;120&quot; /&gt;" title="&lt;img src=&quot;http://newintecco.andy/sites/newintecco.andy/files/imagecache/offerpicture/offers/b_2_0.jpg&quot; alt=&quot;&quot; title=&quot;акция&quot; class=&quot;imagecache imagecache-offerpicture imagecache-default imagecache-offerpicture_default&quot; width=&quot;180&quot; height=&quot;120&quot; /&gt;" href="/node/7">
<img class="imagecache imagecache-offerpicture imagecache-default imagecache-offerpicture_default" width="180" height="120" title="акция" alt="" src="http://newintecco.andy/sites/newintecco.andy/files/imagecache/offerpicture/offers/b_2_0.jpg"/>
</a>
</span>
</div>

As we see, the "alt" and "title" attributes are wrong.

merlinofchaos’s picture

Status: Active » Closed (duplicate)

Please 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

glynster’s picture

This worked a treat and resolved the duplicate and bash created in the title and alt tags. Thanks a bunch.

raphael apard’s picture

I fixed this issue by updating filefield-6.x-3.6 to filefield-6.x-3.7.