Captions are not being added when images are inserted via the Insert module
Steps to recreate:
1. Install Drupal 7.14 using the "standard" install.
2. Install Insert 7.x-1.1 and Caption Filter 7.x-1.2
2. Go to Configuration > Test Formats > Filtered HTML, enable "Convert [caption] tags and allow image alignment"
3. Go to Configuration > Test Formats > Full HTML, enable "Convert [caption] tags and allow image alignment"
4. Go to Structure > Content Types > Article > Manage Fields
5. Under "Image" choose "Edit" from the "Operations" column
6. Click "Enable Title field"
7. Expand the "Insert" menu and check "Use the Title field as a caption" and "Enable insert button"
8. Go to "Add Content" and choose "Article".
9. Add a Title and Body content. Put the cursor where you want to insert the photo.
10. Under image click the [Choose File] button and select a file for uploading. Once done, click the [Upload] button.
11. Add "Alternate Text" text and "Caption" text.
12. Click the [Insert] button next to the image.
13. The image is inserted into the Body text, but the caption is not.
Closer examination reveals that only the HTML code for the image was added; the bracketed caption code was not. e.g.:
<img src="http://bar.foo.com/sites/default/files/field/image/nebula_rcw49_04lrg_0.jpeg" width="1152" height="907" alt="Here's my alt text" title="Here's my caption text" />
I then tested to make sure that the Caption Filter was working by adding some bracketed caption text. It worked just fine on its own. I installed the devel module and turned on error reporting, but I'm not seeing any errors, nor am I seeing any JavaScript errors in the Chrome developer console.
I ran these tests under Mac OS X 10.7 using Chrome 20.0.1132.47 and Firefox 13.0.1
Did I miss something? There was another report of a similar problem in this old issue for 6.x (http://drupal.org/node/1282078).
Comment | File | Size | Author |
---|---|---|---|
#7 | make-caption-filter-work-with-insert-1666792.patch | 1.18 KB | shadcn |
Comments
Comment #1
andreic CreditAttribution: andreic commentedSubscribing, same issue here as the above. Any ideas someone?
Comment #2
technovangelist CreditAttribution: technovangelist commentedSame issue here with 7.14 Minimal
Comment #3
minneapolisdan CreditAttribution: minneapolisdan commentedI also was under the impression that this would just 'work' - that adding Title text to the image, and clicking Insert with the Insert module, the caption would be automatically placed, but so far I've had to type the caption out using the brackets.
Comment #4
Alan D. CreditAttribution: Alan D. commentedDoesn't look like it, hook_insert_content() was not present in 7.x-1.2.
Super trivial if the author decides to implement this. I just hooked up the sandbox File Attributes module to do this (authorinfo is a textarea and author is a textfield on the image)
The sandbox project adds these additional tokens, just like insert does for title & alt, then I added the style like this:
so these bits, '__file_attributes_authorinfo__' would be __title__ or __alt__ and the styles would be:
Comment #5
Alan D. CreditAttribution: Alan D. commentedDuh, I should have looked at the author first (quicksketch, also author of Insert) before pasting in help on how to do this :)
Comment #6
pam.pkrweb@gmail.com CreditAttribution: pam.pkrweb@gmail.com commentedHi
I am having the same issue. Do the same step stated in the original summary on the issue. I get no Caption. Any patch to fix this.
Comment #7
shadcn CreditAttribution: shadcn commentedHere's a quick patch that adds image style + caption support.
Comment #8
siefca CreditAttribution: siefca commentedI've included this patch in my patch, see: http://drupal.org/node/1873900
Comment #9
davidneedhamComment #10
kmontyAfter some testing, it appears the captions are being inserted just fine (it's possible this issue was fixed along with another ticket).
There is an issue that causes captions to be inserted more often than desired. Please track #1985458: Problem with caption_from_title? for progress surrounding the clean-up of general caption insert functionality.