support · Workaround

Sitecore 9.2 – “Value cannot be null – Parameter name: html” when inserting an external link into the text field through experience editor

After upgrading Sitecore XM from version 8.2 Update 6 (aka 8.2.6) to version 9.2 Initial Release (aka 9.2.0), the editors / authors keep reporting that there is an error message “Value cannot be null – Parameter name: html” when inserting an external link for rich text through Sitecore experience editor. This problem is very annoying and then users get bad experience with Sitecore platform so we should fix it as soon as possible.

We can replicate it easily with a fresh Sitecore 9.2.0 instance:

  • log into Sitecore and then access /sitecore/content/Home then switch to Experience Editor
  • select Text field and then click on “Insert an external link into the text field” button

As usual, we ask our best friend Google and then she supposes that it should be a Sitecore bug #371707 https://community.sitecore.com/community?id=community_question&sys_id=9c356b291b4770d0b8954371b24bcbdd

The workaround in this article is working well but we prefer the Sitecore patch if any. We should create a support ticket through Sitecore Support Portal. Unfortunately, there is no Sitecore patch for this issue but Sitecore technical support team proposes a workaround by simply inserting the following script (right after line 525) into the file \sitecore\shell\Applications\Page Modes\ChromeTypes\FieldChromeType.js

//fix 371707
(message === "webedit:insertexternallink" ? ',selection=' + this.getSelectedHtml() : "") +
//end of fix

Note 1: you can download the updated file here

Note 2: this issue is fixed in the Sitecore version 9.3.0 and later

After editing and deploying the updated file, the problem is solved on all environments

Happy Sitecore Workaround!

Advertisement

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.