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 a bad experience with the 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 above updated file.
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!
This article originally appeared on Walking on clouds (https://buoctrenmay.com/).