If you want most items to be included automatically, but want to be able to use the input filter in some advanced case, the files will show up twice.
This patch will make sure that a file that has already been included somewhere in the content, is excluded from auto-inline function.

For example, you have uploaded 3 files, img1, img2 and file1 to a node with 'auto inline files' enabled. In the text of the node you refer to file1 with For more information you can download [inline:file1=this file].. With this patch only img1 and img2 will be added automatically.

This was the behavior that I wanted, perhaps it is of some use for someone else.

CommentFileSizeAuthor
inline_prevent_duplicates.patch3.73 KBmaartenvg

Comments

sun’s picture

Status: Needs review » Needs work

By looking at the patch, $node->files[$fid]->inline seems to be ambigious now. I thought it was (or was planned to be) used for providing information about already auto-inlined images. Now both auto-inline as well as manual inline define the same property.

Please also remove those that inline-auto-inline span tag for now. I can see it's benefit, however, it doesn't belong into this patch.

zilla’s picture

following this issue - will this patch make it to the core? seems like a pretty common use case...