I was trying to get Insert module to work with File Entity Preview. The insert button appears, but clicking "Insert" did not insert the image into the content.

I was able to get it to work by adjusting line 40 in insert.js.

old code - //var wrapper = $(this).parents(settings.wrapper).filter(':first').get(0);
new code -  var wrapper = $(this).parents(settings.wrapper).filter(':eq(1)').get(0);

I know this is not ideal change, but maybe it will help others in similar situation. If there's a way to adjust the code so it will work with File Entity Preview, I'd appreciate it included in the next update of this module.

Comments

b777’s picture

This change will make Insert only insert the first image in the list, so breaks functionality if more than 1 file is in the list... unintended bug created. So I don't recommend this approach.

snater’s picture

Status: Active » Closed (outdated)

File Entity Preview usage peaked at around 500 installations and does not seem to be maintained any more, which does not justify a change specific to that module in the Insert module code. Functionality interfacing these modules should be put into a separate module.