Workaround that ImageVault.EPiServer.UI 5.5.36 does not support non-standard ports

We have upgraded the NuGet package ImageVault.EPiServer.UI to 5.5.36.

This package is used to install ImageVault properties and editor UI into Episerver.

However I noticed that I was unable to add images to the ImageReference properties in Episerver. The “Insert” button was replaced with “Publish”.

iv insert.png

Looking into the javascript errors I found the following:

imagevault-insert-media.min.js:1 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://my-imagevault-core') does not match the recipient window's origin ('https://my-imagevault-core:9901').

As we’re hosting our ImageVault Core on a non-standard port 9901 it looked like something was lost.

Browsing the zip packaged containing the ImageVault UI resources I found the javascript imagevault-insert-media.min.js that it does not include the port when defining the origin.

Patching it up

It was easy to patch the .js file but since I did not want to fool around with the .zip package, I needed to find another way to override the file.

Creating a HttpHandler that listened to the path for the original file, and returning my modified file instead it’s easy for me to implement my fix without the risk of it being overriden. It’s also easy to remove when the fix is patched!

If you need help

If you also experienced this issue, you can find my patch on https://github.com/alfnilsson/ImageVault/tree/master/ImageVault.EPiServer.UI%205.5.36

As it would only be a temporary patch, I don’t think it’s worth creating a nuget package for it.

This is reported to Meriworks, but I hope that this helps you if you encountered the same problems.

Leave a comment