When trying to insert a file named "start middle end.png", I get "startend.png" in the src attribute, so the file can't be found. The preview is OK. It only happens when using Transliteration, whether resize_filter is used or not.

CommentFileSizeAuthor
#3 insert_empty_attributes.patch578 bytesquicksketch
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

Status: Active » Postponed (maintainer needs more info)

I cannot reproduce this issue. Upon uploading a file with the name "start middle end.png", it is automatically renamed to "start_middle_end.png" due to transliteration. Inserting the image produces the expected code:

<img src="http://drupal6/files/images/1/start_middle_end.png" width="75" height="75" alt="" title="" />

I'll need directions to reproduce from a clean install, as it doesn't seem to be a problem with just Insert, ImageField, and Transliteration.

GaëlG’s picture

Status: Postponed (maintainer needs more info) » Active

Oops sorry, it seems like drupal.org displays two spaces as only one. The name is start middle end.png which get renamed to start__middle__end.png. As the title mentions, it's two DOUBLE spaces. I know, this is a strange name, but we're always victims of Murphy's law.

quicksketch’s picture

Status: Active » Fixed
FileSize
578 bytes

Thanks, sorry this took ages to address, but with two underscores I can see exactly what's happening. Because our placeholders are demarked with double underscores, we try to "clean up" left over placeholders that weren't used, such as __description__ or __alt__. This patch corrects the problem by only matching for entirely empty attributes with quotes immediately following and preceding the placeholder, which will prevent this replacement of double underscores elsewhere (such as in the path).

This patch also addresses #1492872: Empty title attributes being matched for captions, since it was right there also.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.