Completed
Last Updated: 11 Feb 2019 10:08 by ADMIN
ADMIN
Rumen
Created on: 10 Dec 2018 16:19
Category: UI for ASP.NET AJAX
Type: Bug Report
0
Track Changes and Comments do not work when ToolProviderID is set
I'm using couple of Rad Editor controls in my webpart and using ToolProviderID for performance optimization.
I'm initializing one rad editor toolbar from server side and using the same toolbar to provide other rad editors with their toolbar, Bascially I'm using ToolProviderID attribute to initialize other RadEditors, after doing this the Comments and Track Changes feature stop working although their options are selected in the toolbar.


<telerik:RadEditor RenderMode="Lightweight" runat="server" ID="RadEditor1" EnableTrackChanges="true" EnableComments="true">
    <TrackChangesSettings Author="AuthorName" CanAcceptTrackChanges="true" UserCssId="reU0" />
    <Tools>
        <telerik:EditorToolGroup>
            <telerik:EditorTool Name="AcceptTrackChange" />
            <telerik:EditorTool Name="RejectTrackChange" />
            <telerik:EditorTool Name="AcceptAllTrackChanges" />
            <telerik:EditorTool Name="RejectAllTrackChanges" />
            <telerik:EditorTool Name="EnableTrackChangesOverride" />
        </telerik:EditorToolGroup>
    </Tools>
</telerik:RadEditor>
<telerik:RadEditor ID="RadEditor2" runat="server" ToolProviderID="RadEditor1" EnableTrackChanges="true" EnableComments="true"></telerik:RadEditor>
<telerik:RadEditor ID="RadEditor3" runat="server" ToolProviderID="RadEditor1" EnableTrackChanges="true" EnableComments="true"></telerik:RadEditor>
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
3 comments
ADMIN
Rumen
Posted on: 11 Feb 2019 10:08
Hi all,

I am following up with good news that the problem is fixed in the Latest Internal Build (Telerik_UI_for_ASP.NET_AJAX_2019_1_211_Dev|Trial_hotfix.zip) which precedes the R1 2019 Service Pack 1 release. 
You can download the nightly build from here (press the the Internal Builds tab to locate the build). 

The release notes are here

Please let us know if you find any issues or side effects with the hotfix.
 
Regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
ADMIN
Rumen
Posted on: 25 Jan 2019 17:59
Hello Akash,

Thank you for reporting this regression. 

The problem will be fixed in the upcoming R1 2019 SP1 release due on Feb 20.

As a temporary workaround I would propose the following override that will fix the error:

<script>
    var $T = Telerik.Web.UI;
    var TOOLBAR_SELECTOR = ".reToolbar,.reToolBar";
    $T.RadEditor.prototype._initializeToolProvider = function () {
        var editor = this;
        var toolProviderID = editor.get_toolProviderID();
        var provider = toolProviderID ? $find(toolProviderID) : null;
 
        if (!provider) {
            return;
        }
 
        var getToolBarHolder = function (adapter) {
            var wnd = adapter.get_window();
            return wnd ? wnd.get_contentElement() : adapter.get_element();
        };
        var toolAdapter = editor.get_toolAdapter();
        var providerToolAdapter = provider ? provider.get_toolAdapter() : null;
        var providerToolBarHolder = getToolBarHolder(providerToolAdapter);
        var providerToolBarElements = providerToolBarHolder ? $(providerToolBarHolder).find(TOOLBAR_SELECTOR) : [];
        var providerToolBarsLength = providerToolBarElements.length;
        var toolsFragment = document.createDocumentFragment();
 
        editor.set_dialogOpener(provider.get_dialogOpener());
 
        var contextJSON = provider.get_contextMenusJSON();
 
        if (contextJSON && contextJSON.concat) {
            editor.set_contextMenusJSON(contextJSON.concat([]));
        }
 
        var modulesJSON = provider.get_modulesJSON();
 
        if (modulesJSON && modulesJSON.concat) {
            editor.set_modulesJSON(modulesJSON.concat([]));
        }
 
        editor.set_toolJSON(provider.get_toolJSON());
        toolAdapter.set_toolJSON(provider.get_toolAdapter().get_toolJSON());
 
        var toolBarContent = getToolBarHolder(toolAdapter);
 
        for (var i = 0; i < providerToolBarsLength; i++) {
            $(providerToolBarElements[i]).clone().appendTo(toolsFragment);
        }
 
        $(toolBarContent).append(toolsFragment);
 
        if (provider.get_spellCheckJSON) {
            editor.set_spellCheckJSON(provider.get_spellCheckJSON());
        }
 
        if (provider.get_ajaxSpellCheckScriptReference) {
            var ref = provider.get_ajaxSpellCheckScriptReference();
 
            if (ref) {
                editor.set_ajaxSpellCheckScriptReference(ref);
            }
        }
 
        editor.set_links(provider.get_links());
        editor.set_colors(provider.get_colors());
        editor.set_fontNames(provider.get_fontNames());
        editor.set_fontSizes(provider.get_fontSizes());
        editor.set_symbols(provider.get_symbols());
        editor.set_realFontSizes(provider.get_realFontSizes());
        editor.set_snippets(provider.get_snippets());
        editor.set_cssClasses(provider.get_cssClasses());
        editor.set_cssFiles(provider.get_cssFiles());
        editor.set_languages(provider.get_languages());
        editor.set_paragraphs(provider.get_paragraphs());
        editor.set_formatSets(provider.get_formatSets());
        editor.set_enableUndoRedo(provider.get_enableUndoRedo());
    }
 
</script>
<telerik:RadEditor RenderMode="Lightweight" ID="RadEditor1" runat="server" ...

I also updated your Telerik points for the inconvenience caused and your valuable feedback.


For everyone who wants to solve the initially reported problem, the solution is to apply the 

<TrackChangesSettings Author="AuthorName" CanAcceptTrackChanges="true" UserCssId="reU0" />

setting tag to all editors:

<telerik:RadEditor RenderMode="Lightweight" runat="server" ID="RadEditor1" EnableTrackChanges="true" EnableComments="true">
    <TrackChangesSettings Author="AuthorName" CanAcceptTrackChanges="true" UserCssId="reU0" />
    <Tools>
        <telerik:EditorToolGroup>
            <telerik:EditorTool Name="AcceptTrackChange" />
            <telerik:EditorTool Name="RejectTrackChange" />
            <telerik:EditorTool Name="AcceptAllTrackChanges" />
            <telerik:EditorTool Name="RejectAllTrackChanges" />
            <telerik:EditorTool Name="EnableTrackChangesOverride" />
        </telerik:EditorToolGroup>
    </Tools>
</telerik:RadEditor>
<telerik:RadEditor ID="RadEditor2" runat="server" ToolProviderID="RadEditor1" EnableTrackChanges="true" EnableComments="true">
    <TrackChangesSettings Author="AuthorName" CanAcceptTrackChanges="true" UserCssId="reU0" />
</telerik:RadEditor>
<telerik:RadEditor ID="RadEditor3" runat="server" ToolProviderID="RadEditor1" EnableTrackChanges="true" EnableComments="true">
    <TrackChangesSettings Author="AuthorName" CanAcceptTrackChanges="true" UserCssId="reU0" />
</telerik:RadEditor>


Best regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Akash
Posted on: 23 Jan 2019 14:21

Hi Rumen,

I had initially raised this bug with ToolProviderID is this issue resolved and available in the 2019.1.115.45 version of the Telerik.Web.UI.dll.

Because i have taken the latest Update for Telerik and seems that without the extra attributes EnableTrackChanges="true" EnableComments="true" dont work for RADEditor control using ToolProviderID.