First let me say - FANTASTIC module! I help maintain a few non-profit sites and this will make image updating so much easier for the end-users - thank you!

I have run into an issue with Title and ALT tags not being automatically "inserted" into uploaded images (IMG tags). I have followed the MustardSeed Media tutorial (excellent resource btw) and image uploading/resizing are working just fine. However, even though custom entry for ALT+TITLE tags is enabled for the filefield (image widget) within the content type, neither Title or ALT tags are "inserted" into TinyMCE.

In order to prevent duplicate display of images, the MustardSeed video mentions to set both the field display for Teaser and Full Node to "hidden" - which I have done. However, for testing this issue, I enabled both, and set the display to Imagacache presets. When this was done duplicate images appear (as they should) - first the "FileField" image, then the "Insert" image appear. The standard FileField image (using imagecache presets) correctly includes the ALT+TITLE tags within the IMG tag, whereas, the "Insert" images do not:

<!-- FIRST IMAGE - "FILEFIELD" -->
<div class="field field-type-filefield field-field-node-images">
    <div class="field-items">
            <div class="field-item odd">
                  <div class="sb-image sb-indivdual">
				   <a href="http://localhost/sites/default/files/images/uploads/example.jpg" rel="shadowbox" title="This is the title of the image">
				   <img src="http://localhost/sites/default/files/imagecache/main/images/uploads/example.jpg" alt="Test ALT Using Tokens" title="This is the title of the image" class="imagecache imagecache-main" width="400" height="268" /></a>
				  </div>
		   </div>
     </div>
</div>

<!-- SECOND IMAGE - "INSERT" -->
<div class="inserted">
	<a href="http://localhost/sites/default/files/imagecache/main/images/uploads/example.jpg" rel="shadowbox">
		<img src="http://localhost/sites/default/files/resize/imagecache/main/images/uploads/example-268x179.jpg" width="268" height="179" class="imgcaption floatl" />
	</a>
</div>

I am wondering if this may have something to do with the "Insert Styles?" Actually - I wasn't certain what a couple of the options referenced (E.G. Acting like a noob here - what does the style setting for "Automatic" mean? I am assuming that the setting for "Original Image" simply loads the image in original size :-)

I'm not certain if this possibly relates to issue #611158: alt and title attributes get string "undefined" as value - However, I believe Insert 6.x-1.0-beta2 has corrected this.

Any suggestions/advice you could provide would be GREATLY appreciated. Insert is really going to solve a lot of problems for non-experienced users as soon as I can get everything worked out!

P.S.

I am using the current versions of ImageCache, TinyMCE, WYSIWYG, Image Resize Filter, FileField, ImageField & Insert

Best regards!

Comments

quicksketch’s picture

You should note that Insert only inserts the title/alt that is existing *before you click Insert*. So if you added the title and alt text later, it won't affect what's in the body. Sounds like that might be the case here, since in my testing the alt and title text is being inserted just fine.

FWE’s picture

Hi quicksketch - thanks for the quick reply.

Absolutely - that makes sense. My process is: When creating a new node (1) Upload image using the filefield/image-widget, (2) Enter the image title in the provided title field (ALTs are handled with Tokens), and lastly (3) select "insert" to send to TinyMCE.

The code I posted in my first post above shows the HTML output of one image posted. Two images were produced (e.g. "duplicated") since the display options for Teaser & Full Node were not set to "hidden" - rather, set to ImageCache presets. Title and ALT tags were correctly handled in the first instance of the image, but not the second. FYI - the second image would be the only one to appear if the Teaser & Full Node display options for the filefiled were set to "hidden.".

May I ask what your configuration settings are for your FileField/Image-Widget field in your content type?

quicksketch’s picture

Status: Active » Fixed

I don't have any *particular* settings, since I maintain dozens of websites and all of them use different settings. The only one I always recommend is that you use set an "Upload path", to make sure your files are uploaded to some logical location rather than dumping them all in the file root.

If there are no other questions regarding the Title and ALT tags, this issue should be closed. We try not to bunch questions together because it makes it difficult to find information by searching for other users.

FWE’s picture

StatusFileSize
new15.38 KB

Thanks again quicksketch - I certainly appreciate it.

My apologies for the multiple questions - I will focus on my main issue - which still exists.

In my effort to pinpoint why this is not working I have disabled TinyMCE and Image Resize Filter. I am now working with a basic text area in order to limit the influence of other modules. As a result, Title and ALT tags are now being "inserted" - however, they are blank. I have attached a screen shot to demonstrate.

Output HTML:

<img src="http://localhost/sites/default/files/images/example.jpg" width="496" height="640" alt="" title="" />

Do you prefer that I close this issue and re-open as a potential bug?

quicksketch’s picture

Category: support » bug
Status: Fixed » Active

Let's continue if the problem still exists. Disabling tinyMCE definitely helps narrow it down, but oddly I still can't reproduce this problem. I set up a field as so:

- Create new content type "article"
- Add a new field "field_image" (type: File, widget: Image) to the "article" type.
- Check "Enable insert button"
- Do not check any "Enabled insert styles"
- "Default insert style": Automatic (btw, this means it will insert an img tag for jpg, png, and gifs, links for everything else)
- Check "Enable custom title text"
- Check "Enable custom alternate text"
- Leave defaults for all other options.

- Create an article at node/add/article.
- Upload a file, enter alt and title, click "Insert"

So I'm not sure where the problem is, I can't reproduce it. :-/

FWE’s picture

StatusFileSize
new15.08 KB

Again - I certainly appreciate your taking the time to provide assistance - this is rather puzzling to say the least.

As a final step to see what's happening, I have done the following:

Fresh install of Drupal 6.14

- Contrib Modules:
--- CCK 6.x-2.5
--- FileField 6.x-3.1
--- ImageField 6.x-3.1
--- Insert 6.x-1.0-beta2

--- Theme "Foundation"
--- Input format: Full HTML - ALL filters disabled

As per your instructions - "Followed To-a-T"

RESULT:

ALT entries appear in the HTML code when images are inserted - However, Titles do not - they are blank. I have attached another screen shot to demonstrate the code after "inserting."

I have tested with Firefox 3.014, IE 7, Safari for Win and Google Chrome - same results. After reading about some issues with "a" Titles and ALTS under the ImageField project - I am wondering if there is a connection? I will continue to work through this - however, at this point I my Drupal install is bare-bones, not many variables to create conflict...unless my laptop has gremlins :-)

Thanks again!

FWE’s picture

Just updated FileField & ImageField to v3.2 - No change, still not "inserting" titles...will continue.

bradweikel’s picture

I'm seeing this as well - ALT's show up but no Titles. Will investigate further this weekend.

quicksketch’s picture

After a complete fresh reinstall of Drupal, it's now not working for me either (yay!) No idea why it *was* working before. :P

FWE’s picture

Then I am not crazy :P

I will tinker as well to see if I can find anything.

FWE’s picture

Problem solved.

insert/includes/imagefield.inc (line 18):

'title' => 'input[name$="[title]", textarea[name$="[title]"]',

Should be:

'title' => 'input[name$="[title]"], textarea[name$="[title]"]',
FWE’s picture

Status: Active » Fixed
quicksketch’s picture

Status: Fixed » Reviewed & tested by the community

Nice, thanks cheuyungphat! Marking RTBC so I can commit this next time I'm working on Insert.

gooddesignusa’s picture

subscribing

deciphered’s picture

A side note, that may even belong in another issue, but I noticed that Insert is only inserting Custom ALT / Title values, not the default values.

If you would like this in another issue, let me know, but I do believe it falls under the title of this issue.

Cheers,
Deciphered.

troyer’s picture

Status: Reviewed & tested by the community » Needs work

Could you please commit a version that has this bugfix included?
http://drupal.org/node/612928#comment-2207598

This issue is lingering for months and it's just a simple bracket to fill in.

Anonymous’s picture

yes, please. :)

deciphered’s picture

Status: Needs work » Reviewed & tested by the community

@drupidoo,

Changing the the status from 'reviewed & tested by the community' to 'needs work' is actually likely to delay the fix going in rather than speed up the process, so don't do that.

Secondly, quicksketch has a lot on his plate and unless he is personally affected by this issue will likely have higher priorities. If you really wanted to help you could offer your assistance as a co-maintainer of the module so you could push the change through yourself.

If you are unable to offer your assistance, please don't hound, maintaining and developing modules is something that most dev's do in their own time for no payment.

Cheers,
Deciphered.

quicksketch’s picture

Status: Reviewed & tested by the community » Fixed

Committed per #11. I'll push out a beta3 shortly.

Status: Fixed » Closed (fixed)

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

tsvenson’s picture

Version: 6.x-1.0-beta2 » 6.x-1.0-beta3
Status: Closed (fixed) » Active

Using beta3 and I only get the alt text inserted, title is not. I did verify that the fix in #11 was in my installation.

I Am using WYSIWYG with FCKEditor, but even if I disable the editor I still get title="".

drupalfan2’s picture

I am using actual versions of all modules and even if I disable richtext editor I get alt="". title is inserted correctly. Alt text is empty although filled in previously.

I would patch this by myself, but where is the bug located?

drupalfan2’s picture

I found out why ALT text is not being inserted:

I am using textareas instead of textfield for ALT text of imagefield image:
http://drupal.org/node/331713#comment-1428668
http://drupal.org/files/issues/imagefield-331713-27.patch

Is there a way to patch (by myself) Insert module to work with textarea instead of textfield for imagefield ALT text?

quicksketch’s picture

Status: Active » Fixed
StatusFileSize
new727 bytes

Our fix only made "title" text work correctly, this patch should make it so that the "alt" text works fine if it's a textarea also.

Status: Fixed » Closed (fixed)

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