This is a migrated thread and some comments may be shown as answers.

MakeUrlsAbsolute error in IE9

16 Answers 194 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Danny
Top achievements
Rank 1
Danny asked on 17 Mar 2011, 07:53 PM
Hi,

I've just upgraded to the Q1 2011 release of ASP.NEt Ajax and installed IE9. When the editor loads up it generates the following error in a dialogue box on the screen:

"Error while executing filter MakeURLsAbsolute - TypeError: Unable to get value of the property 'InnerHTML': object is null or undefined."

I do not get this issue with IE8. It looks like a problem specific to IE9.

Any ideas?

Thanks

Tim 

16 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 19 Mar 2011, 02:52 PM
Hi timmy,

 We have not been contacted with such a problem before and we are not sure how to reproduce it. Would you please try to reproduce it in one of our online demos or send us a live url along with detailed reproduction steps and explanations? Once we observe the problem, we will get a better understanding on what is actually going on and we will do our best to help.

All the best,
Svetlina
the Telerik team
0
Danny
Top achievements
Rank 1
answered on 21 Mar 2011, 03:47 PM
Hi,

Thanks for your repsonse.

I've attached a screen shot showing the issue. In this case IE9 is running on Windows Server 2008 Standard R2. The error is generated when the screen loads or I click on the HTML tab at the base of the editor. When i insert an image, the URL of it has been changed to be absolute. I set the property using: radeditor1.EnableFilter(EditorFilters.MakeUrlsAbsolute)

It is a major issue for me as I use IE on XP most of the time but as I came across it on our server I thought you should be aware of it.

Thanks

Tim 
0
Rumen
Telerik team
answered on 23 Mar 2011, 03:42 PM
Hi Tim,

You are the first that report this error and we are unable to reproduce it. Could you please answer Svetlina's question about whether you are able to reproduce this error in our live demos, for example: Default Settings?

What you can do is to overwrite the MakeUrlsAbsolute's code and replacing the

if ($telerik.isIE)
with
if ($telerik.isIE && elements[i])



<telerik:RadEditor ID="RadEditor1" ContentFilters="MakeUrlsAbsolute" runat="server"></telerik:RadEditor>
<script type="text/javascript">
    Telerik.Web.UI.Editor.MakeUrlsAbsolute.prototype._updateElements = function (contentElement, tagName, attrName) {
        var tempDiv = contentElement.ownerDocument.createElement("div");
        var elements = this._getElements(contentElement, tagName);
        if (elements)
            for (var i = 0; i < elements.length; i++) {
                var attrValue = elements[i].getAttribute(attrName, 2);
                if ("href" == attrName && attrValue) {
                    tempDiv.innerHTML = "<a href=\"" + attrValue.replace(/\"/gi, "%22") + "\">test</a>";
                    if ($telerik.isIE && elements[i]) {
                        alert(1);
                        var origContent = elements[i].innerHTML;
                    }
 
                    elements[i].setAttribute("href", tempDiv.childNodes[0].href);
 
                    if ($telerik.isIE && elements[i]) {
                        //IE only issue - when setting the href attribute of a link and the link text also looks
                        //like a link/email then the text is overridden with the new href. We need to restore the
                        //original content
                        if ((origContent.indexOf("www.") == 0 && elements[i].innerHTML.match("[a-z]+://")) ||
                    (origContent.indexOf("mailto:") == -1 && elements[i].innerHTML.match("mailto:"))) {
                            elements[i].innerHTML = origContent;
                        }
                    }
                }
                else if ("src" == attrName && attrValue) {
                    tempDiv.innerHTML = "<img src=\"" + attrValue.replace(/\"/gi, "%22") + "\" />";
                    elements[i].setAttribute("src", tempDiv.childNodes[0].src);
                }
            }
        tempDiv.innerHTML = "";
        tempDiv = null;
    }
</script>

Of course you can use this code to debug the error and see what is causing the error on your end.

All the best,
Rumen
the Telerik team
0
Danny
Top achievements
Rank 1
answered on 23 Mar 2011, 04:06 PM
Rumen,

Thanks for the reply.

I wasn't able to reproduce the error in your demos'. In my last post I mistakenly typed that it was a major issue. What I meant to say was that it isn't a major issue for me, just something I noticed on the server and wanted to let you know.

If it rears its head as and when I use IE9 regularly, I'll let you know. Many thanks for your help.

Regards

Tim
0
Lucas Boshoff-James
Top achievements
Rank 1
answered on 25 Mar 2011, 07:47 AM
I have exactly the same problem, however only on one computer.  Both are version 9.0.8112.16421 running on Windows 7 Ultimate.  Both are access the same editor on the same site, editing the same document under the same account, but one of them gets this error.

This was happening BEFORE I updated to the  2011.1 315 (Mar 16, 2011) release, and is still happening.

0
Rumen
Telerik team
answered on 29 Mar 2011, 01:44 PM
Hello Lucas,

Could you please see whether the IE browser is localized to non En-US language? Please, disable all add-ons and see whether the problem is not due to some of them.

If you still experience the problem try the provided solution in my earlier post:
<telerik:RadEditor ID="RadEditor1" ContentFilters="MakeUrlsAbsolute" runat="server"></telerik:RadEditor>
<script type="text/javascript">
    Telerik.Web.UI.Editor.MakeUrlsAbsolute.prototype._updateElements = function (contentElement, tagName, attrName) {
        var tempDiv = contentElement.ownerDocument.createElement("div");
        var elements = this._getElements(contentElement, tagName);
        if (elements)
            for (var i = 0; i < elements.length; i++) {
                var attrValue = elements[i].getAttribute(attrName, 2);
                if ("href" == attrName && attrValue) {
                    tempDiv.innerHTML = "<a href=\"" + attrValue.replace(/\"/gi, "%22") + "\">test</a>";
                    if ($telerik.isIE && elements[i]) {
                        alert(1);
                        var origContent = elements[i].innerHTML;
                    }
  
                    elements[i].setAttribute("href", tempDiv.childNodes[0].href);
  
                    if ($telerik.isIE && elements[i]) {
                        //IE only issue - when setting the href attribute of a link and the link text also looks
                        //like a link/email then the text is overridden with the new href. We need to restore the
                        //original content
                        if ((origContent.indexOf("www.") == 0 && elements[i].innerHTML.match("[a-z]+://")) ||
                    (origContent.indexOf("mailto:") == -1 && elements[i].innerHTML.match("mailto:"))) {
                            elements[i].innerHTML = origContent;
                        }
                    }
                }
                else if ("src" == attrName && attrValue) {
                    tempDiv.innerHTML = "<img src=\"" + attrValue.replace(/\"/gi, "%22") + "\" />";
                    elements[i].setAttribute("src", tempDiv.childNodes[0].src);
                }
            }
        tempDiv.innerHTML = "";
        tempDiv = null;
    }
</script>


Best regards,
Rumen
the Telerik team
0
Lucas Boshoff-James
Top achievements
Rank 1
answered on 12 Apr 2011, 06:14 AM
Hi Rumen, my browser is set to English Australia (EN-AU).  I also tried your sugged fix but it didn't make any difference.

Thanks
Lucas
0
Danny
Top achievements
Rank 1
answered on 12 Apr 2011, 09:39 AM
Hi,

Since I've upgraded my laptop to IE9, I am also getting this error again. I've created a test account on my system so you can see it for yourselves.

Log into www.inboxsystems.com with email of telerik@telerik.com and password of telerik5. Hover over the 'Email campaign' menu option and then click 'create campaign'. You will see the error displayed on that page. It occurs on all pages where I use the HTML Editor.

Please let me know once you've finished with this account and I will remove your access.

Thanks

Tim
0
Rumen
Telerik team
answered on 14 Apr 2011, 02:08 PM
Hi guys,

I have good news that the problem was fixed and it does not exist in Q1 2011 SP1. You can verify this by enabling the filter in the Built-in Content Filters demo and pasting full HTML content in HTML mode.

Greetings,
Rumen
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Lucas Boshoff-James
Top achievements
Rank 1
answered on 14 Apr 2011, 11:31 PM
I have been on Q1 2011 for a couple of weeks now, and have just tried the latest internal built (2011.1.405 Dev Hotfix) and I am still having the same problem.  I can't find anywhere to download SP1 from.  Is it available yet?

I have also been investigating what seems to be a related problem.  When switching between design and html view in IE9 I am not only getting the above mentioned error, but at the bottom of the current table call I am getting " </br>
                     <br>
                    </br>
                    <br>
                    </br>
                    <br>
                    </br>" inserted.  More are inserted every time I switch views.  I have read a number of other forum posts regarding this and none of the fixes so have worked.

This is becoming a real problem for my users.

Thanks
0
Rumen
Telerik team
answered on 18 Apr 2011, 02:20 PM
Hello Lucas,

You can download the Q1 2011 SP1 release by logging into your account -> Download and Manage your products -> click the >> Download Installer and Other Resources button next to Telerik Premium Collection for .NET -> Browse all product files next to RadControls for ASP.NET AJAX -> DLL, Scripts and Skins only or Manual Installation.

If you still experience the problem after the upgrade, please provide sample content and steps to reproduce it in the the Built-in Content Filters demo. Thank you for your cooperation.

Best regards,
Rumen
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Mike Bridge
Top achievements
Rank 1
answered on 20 Apr 2011, 07:11 PM
Hi-

I'm able to reproduce this in IE8 when someone enters a space or non-breaking space  in the domain of their URL.  There are possibly other conditions, but this is the one that works in my test code:

<div runat="server" id="divHolder">
  
</div>

... Ok, well the "Format Code Block" button stopped working so here is the rest:

        protected void Page_Load(object sender, EventArgs e)
        {
            CreateEditor();
        }

        private void CreateEditor()
        {
            _radeditor = new RadEditor
                             {
                                 EditModes = EditModes.Design | EditModes.Html,
                                 Content = "<a href=\"http://www.telerik.com&nbsp;\">Test</a>",
                             };
            _radeditor.EnableFilter(Telerik.Web.UI.EditorFilters.MakeUrlsAbsolute);
            divHolder.Controls.Add(_radeditor);
        }

When you load this window, or switch between Design and HTML mode it will give you "Error while executing filter MakeUrlsAbsolute - [object Error]"


      
0
Mike Bridge
Top achievements
Rank 1
answered on 20 Apr 2011, 07:17 PM
Forgot to mention that this was also reported in IE7, and I am using the latest 2011.1.413 build.
0
Dobromir
Telerik team
answered on 21 Apr 2011, 08:48 AM
Hi Mike,

I already answered your support ticket on the subject. For convenience I will paste my answer here as well.

I have logged this issue into our database and we will do our best to have it fixed for one of the upcoming releases. Here you can find the PITS Issue: Public URL. Unfortunately, I am unable to provide a suitable workaround at this point. Please excuse us for the inconvenience.

Regards,
Dobromir
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
David Moore
Top achievements
Rank 1
answered on 03 Apr 2012, 04:39 PM
Has there been a resolution to this issue?  I am having the same problem with IE8.
0
Dobromir
Telerik team
answered on 03 Apr 2012, 07:55 PM
Hello David,

This problem has not be resolved yet because we had planned tasks with higher priority. I have contacted the developers of RadEditor to increase the priority of this issue.

All the best,
Dobromir
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Editor
Asked by
Danny
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Danny
Top achievements
Rank 1
Rumen
Telerik team
Lucas Boshoff-James
Top achievements
Rank 1
Mike Bridge
Top achievements
Rank 1
Dobromir
Telerik team
David Moore
Top achievements
Rank 1
Share this question
or