Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CKEditor not loading on site after upgrade from 9.8.1 to 9.9.0 #4536

Closed
5 of 8 tasks
james7342 opened this issue Mar 2, 2021 · 42 comments
Closed
5 of 8 tasks

CKEditor not loading on site after upgrade from 9.8.1 to 9.9.0 #4536

james7342 opened this issue Mar 2, 2021 · 42 comments

Comments

@james7342
Copy link

james7342 commented Mar 2, 2021

Description of bug

Upgraded my test site yesterday from 9.8.1 to 9.9.0. In testing I"m not able to CKEditor appear when trying to edit HTML module. Tried clearing browser cache. Tried on Mac OS Safari, Firefox, Chrome & Windows Edge and Linux Firefox and Chrome. Same issue across various OS and browsers. Note this site as has been upgrade over the years. I think it originated back in the 6.X days

Steps to reproduce

Try to edit HTML module

Current behavior

Editor is not loading.

Expected behavior

Editor loads to edit module

Screenshots

screenshot_2066

Error information

screenshot_2067

Affected version

  • 10.00.00 alpha build
  • 09.09.00 latest supported release

Affected browser

  • Chrome
  • Firefox
  • Safari
  • Internet Explorer 11
  • Microsoft Edge (Classic)
  • Microsoft Edge Chromium
@james7342
Copy link
Author

Further investigation on another Local DNN Test/Dev instance (DNNDev.Me). That was also upgrade from 9.8.1 to 9.0.9. This site works fine and doesn't display the error message in console. Looking at the folder structure version 4.5.3 does have the newsarticleslinks, but the new version 4.15.1 does not.
screenshot_2068
screenshot_2069

@bdukes
Copy link
Contributor

bdukes commented Mar 2, 2021

newsarticleslinks is not a built-in plugin, so it looks like you're referencing some additional plugin that has been manually added to the site. You should try copying the folder from the 4.5.3 folder to the 4.15.1 folder and see if that helps.

@james7342
Copy link
Author

james7342 commented Mar 2, 2021

@bdukes Not try to dispute what you're saying but I have it on 3 different sites. All 3 sites have originated from different versions of DNN. Site 1 want to say 5.X days, Site 2 - 6.X and DNNdev.me site - 9.X. And I've never touched this folder structure.

screenshot_2091
screenshot_2092

@bdukes
Copy link
Contributor

bdukes commented Mar 2, 2021

Looks like it was part of the previous CKEditor provider

@james7342
Copy link
Author

james7342 commented Mar 2, 2021

/*********************************************************************************************************/
/**
 * Ventrian News Articles Article Link Selector plugin for CKEditor by Ingo Herbote
 * Released: On 2013-02-17
 */
/*********************************************************************************************************/

( function() {
    CKEDITOR.plugins.add( 'newsarticleslinks',
    {
        requires: [ 'iframedialog' ],
		lang: ['de', 'en', 'pl'],
        init: function( editor )
        {
           var me = this;
		   
           CKEDITOR.dialog.add( 'newsarticleslinksDialog', function (editor)
           {
              return {
                 title : editor.lang.newsarticleslinks.title,
                 minWidth : 550,
                 minHeight : 160,
                 contents :
                       [
                          {
                             id : 'iframe',
                             label : 'Article Links',
                             expand : true,
                             elements :
                                   [
                                      {
						               type : 'html',
						               id : 'pagenewsarticleslinks',
						               label : 'Article Links',
						               style : 'width : 100%;',
						               html : '<iframe src="'+me.path+'/dialogs/newsarticleslinks.aspx" frameborder="0" name="iframenewsarticleslinks" id="iframenewsarticleslinks" allowtransparency="1" style="width:100%;margin:0;padding:0;"></iframe>'
						              }
                                   ]
                          }
                       ],
                 onOk : function()
                 {
					for (var i=0; i<window.frames.length; i++) {
					   if(window.frames[i].name == 'iframenewsarticleslinks') {
						   
					      
						  var index = window.frames[i].document.getElementById("ArticlesList").selectedIndex;

                          var linkUrl = window.frames[i].document.getElementById("ArticlesList").value;
						  var linkText = window.frames[i].document.getElementById("ArticlesList").options[index].text;
					   }
					}
                    editor.insertHtml('<a href="' + linkUrl + '" title="' + linkText + '">' + linkText + '</a>');
                 }
              };
           } );

            editor.addCommand( 'newsarticleslinks', new CKEDITOR.dialogCommand( 'newsarticleslinksDialog' ) );

            editor.ui.addButton( 'newsarticleslinks',
            {
                label: editor.lang.newsarticleslinks.button,
                command: 'newsarticleslinks',
                icon: this.path + 'icon.gif'
            } );
        }
    } );
} )();

@sleupold
Copy link
Contributor

sleupold commented Mar 2, 2021

Brian is correct, this plugin was added by Ingo some years ago in his original version of the CKEditor provider. DnnConnect CKEditor provider is based on Ingo's provider, but removed most of the plugins he wrote and included. You might transfer the plugin yourself, but need to register it as well in the editor configuration

@james7342
Copy link
Author

james7342 commented Mar 2, 2021

I'd much rather just remove it. I don't use the News Article Module and to be honest don't ever remember installing Ingo's version of the editor either. Especially on my DNNDev.me environment, which is working correctly.

screenshot_2072

@james7342
Copy link
Author

screenshot_2063
screenshot_2064
screenshot_2073

This is the only versions I have installed.

Sorry, if I'm seem to be disputing this, but I can not honestly remember installing anything out side of what is bundled with DNN.

@james7342
Copy link
Author

james7342 commented Mar 2, 2021

Just extracted DNN 8.0.0 upgrade and Install zip file. In the install/Provider folder extracted the DNN DNNConnect.CKEditorProvider_01.00.01_Install followed by the resources.zip. Both the install and upgrade have this plugin folder. This leads me to believe it was installed as part of the upgrade/install of 8.x.
screenshot_2074
screenshot_2075

Which leads me to next question. How does this get cleaned up? Considering I never installed anything outside of doing DNN upgrades.

@james7342
Copy link
Author

@bdukes
Copy link
Contributor

bdukes commented Mar 2, 2021

It's no problem @james7342, thanks for digging into this 😃

It looks like this plugin was removed via DNN-Connect/CKEditorProvider#66. Based on timing, this was probably included in 8.01 or 8.0.2, so probably only sites that upgraded to 8.0.0 would have this old plugin. We'll need to see what can be done to adjust the configuration for this scenario.

@bdukes
Copy link
Contributor

bdukes commented Mar 2, 2021

Can you go to Site Settings in the Persona Bar, select the Site Behavior tab, the More sub-tab, then click the Open HTML Editor Manager button. In the HTML Editor Manager, open the Editor Config tab on the right, and scroll down to the ExtraPlugins field, does that include newsarticleslinks? If so, just removing that should be all that you need in order to fix the issue (but you'll need to do it for each site/portal).

@bdukes
Copy link
Contributor

bdukes commented Mar 2, 2021

That interface is an editor over the three Dnn.CK*.xml files in the site root (e.g. Portals\0\Dnn.CKEditorSettings.xml). You can look for extraPlugins in that file, also, if you have many sites to adjust.

@james7342
Copy link
Author

james7342 commented Mar 2, 2021

It's in the GUI Config Editor..
screenshot_2077

Files in Portals\0
screenshot_2078

File DNN.CKEditorSettings.xml
<Config allowedContent="true" autoGrow_bottomSpace="0".............extraPlugins="newsarticleslinks,dnnpages"

File CKeditorSettings.xml
<Config allowedContent="true"........extraPlugins="mathjax,oembed,syntaxhighlight,tableresize,textselection,stylesheetparser,qrcodes,newsarticleslinks,codemirror,dnnpages,xmltemplates,wordcount"

Based upon your comments it's probably safe to remove the non prefixed "Dnn.CK*" Files.

@james7342
Copy link
Author

james7342 commented Mar 2, 2021

You sure it's storing this data in the XML files? I'm trying to delete the settings and the file time stamps are not changing and the save doesn't really seem to do much. As I delete the values in the GUI and when I go back in there the values are back.

@james7342
Copy link
Author

Looks like the settings are stored in the DB in table : CKE_Settings
screenshot_2080

@james7342
Copy link
Author

In SQL I ran this, SELECT * FROM CKE_Settings Where SettingName LIKE '%Plugins'
screenshot_2081

@bdukes
Copy link
Contributor

bdukes commented Mar 2, 2021

I think the files are used as defaults, and the settings are overrides, but it's possible the files aren't used at all. I believe in your examples here DNNCKP#0#ExtraPlugins is for portal 0, and DNNCKT#88#ExtraPlugins is for tab 88, FYI. Given that there are settings for portal 0, maybe the file in Portals\0 is totally ignored 🤷🏻‍♂️

@TopCat6
Copy link

TopCat6 commented Mar 2, 2021

I have found this problem in 4 sites I upgraded from 9.8.0 to 9.9.0. Copying over the old 4.5.3 plugins fixed the problem for now. BTW, once newsarticleslinks was copied over, the same issue occurred for iframedialog. Copying over iframedialog fixed that with no more issues.

Question: Should I remove these two plugins through the Editor interface to avoid more problems with future DNN updates?
Later edit: Editor shows only newsarticleslinks,dnnpages for ExtraPlugins.

@TopCat6
Copy link

TopCat6 commented Mar 2, 2021

Even in the ones that didn't require patching with old plugin files, the Icon Legend images are missing. I'll start a new issue for that.
image

Icons Issue: #4537

@sleupold
Copy link
Contributor

sleupold commented Mar 2, 2021

Background info: when Mauricio Marquez created the FCK Editor provider for DNN 4, he used the files and HostSettings table (even for site, page and module specific settings).
When Ingo took over the project, he moved settings to the database dedicated table, but kept the combined key, which optionally include portalid, tabid and moduleid (for SQL, IMO it would be preferable to use a multicolumn key instead. That would allow easy removal of obsolete keys, when a module, page or portal is deleted. Performancewise, there shouldn't be a big difference, as the table rarely contains more than a few thousand entries.

@sleupold
Copy link
Contributor

sleupold commented Mar 2, 2021

Icon images might depend on the Editor theme being used (specified in Editor basic settings.
Note: CKEditor from Ingo shipped with multiple themes, but AFAIR the dnnConnect excluded most of it.

@james7342
Copy link
Author

james7342 commented Mar 2, 2021

Going to try and create synopsis of what I did and how I fixed this. I'm going to prefix this with a proceed with caution and backup your site before you do any of this.

  1. Went to the GUI and delete the extraPlugins values.
    screenshot_2086
    screenshot_2087
    Note: The values don't seem to be removed from the GUI after saving as a refresh and they're back.
  2. Confirmation via the the SQL console with SELECT * FROM CKE_Settings WHERE SettingName LIKE '%Plugins'. The values are now removed
    Note: If you have customized the editor for various pages or modules you may have something similar to below. You will need to figure out where else the editor is located within Pages or Modules. In my case 88 was referencing a Events module that I customized the editor toolbar.
    screenshot_2081
  3. Edit /portals/0/Dnn.CKEditorSettings.xml and update the existing value of extraPlugins: <Config ......extraPlugins="dnnpages">
  4. Servers/Clear Cache
  5. Servers/Restart Application

Check Editor should work at this point. At least it did for myself.

Optional Cleanup. Since I was at it I figured I would also try and clean up all the old folder junk.
If present:

  1. Delete old Configuration XML files that are not used anymore
    screenshot_2085
  2. Delete the CKEditor and CKFinder from the top level folder DNNConnect.CKE
    screenshot_2083
  3. I haven't done it yet but I might test with deleting this folder also. Just holding off at the moment to properly test everything. I have been pretty aggressive with my cleanup efforts.
    screenshot_2088

@james7342
Copy link
Author

james7342 commented Mar 2, 2021

Icon images might depend on the Editor theme being used (specified in Editor basic settings.
Note: CKEditor from Ingo shipped with multiple themes, but AFAIR the dnnConnect excluded most of it.

Both instances of 9.9.0 aren't displaying images where as 9.8.1 is. All 3 are using moono skin/theme

@TopCat6
Copy link

TopCat6 commented Mar 2, 2021

I believe new installations have ExtraPlugins: set to dnnpages only. In your steps you seem to be removing both newsarticleslinks and dnnpages. Do we need dnnpages or can we safely remove it?

@james7342
Copy link
Author

james7342 commented Mar 2, 2021

@TopCat6 I gave up using the GUI as it never seem to make much of a difference or do anything other than save the value to the DB. Not sure if it actually has any impact. Step 3 I adjusted the xml config file and put "dnnpages" in it.

Edit /portals/0/Dnn.CKEditorSettings.xml and update the existing value of extraPlugins: <Config ......extraPlugins="dnnpages">

@TopCat6
Copy link

TopCat6 commented Mar 3, 2021

@james7342 Ok, thanks. I'll give it a try.

@james7342
Copy link
Author

And just for clarity this is what my 4.15.1 plugins folder looks like. The offending newsarticleslinks plugin plus any additional as I did not copy anything into this folder from the 4.5.3 plugins.
screenshot_2093

@james7342
Copy link
Author

james7342 commented Mar 3, 2021

Found this also in https://github.com/dnnsoftware/Dnn.Platform/blob/develop/DNN%20Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Install/Dnn.CKEditorDefaultSettings.xml

"extraPlugins="dnnpages,wordcount,notification"

Not sure if wordcount and notification should be in there. wordcount still exists as valid plugin, but notification looks like it's been removed. Not sure how this file is used.

@TopCat6
Copy link

TopCat6 commented Mar 4, 2021

I did it and it worked on all sites. However, one must remember to do all the portals on the site, and then for completeness, I recommend doing the one for the _default portal, too.

Edit /portals/0/Dnn.CKEditorSettings.xml and update the existing value of extraPlugins: <Config ......extraPlugins="dnnpages">

The file there will be called: Dnn.CKEditorDefaultSettings.xml

Edit /portals/_default/Dnn.CKEditorDefaultSettings.xml

@james7342 BTW, I found that changing in the GUI worked and stuck as long as I hit the Save button at the bottom. :)

@james7342
Copy link
Author

james7342 commented Mar 4, 2021

@TopCat6 Good catch on the _default portal. The GUI worked for you? That's good, for me it would save, but as soon as I went back in there it had some values in it. Currently it has "dnnpages,wordcount,notification" in the GUI even though the DB shows it as being empty, all the XML files have been updated. So not sure where these values are coming from.

@james7342
Copy link
Author

james7342 commented Mar 4, 2021

Did another quick test. I cannot figure out where it’s coming from or how it’s doing this. If I save from the GUI I get all 3 non “Dnn” prefixed configuration files back. The CKEditorSettings.xml, CKToolbarButtons.xml and CKToolbarSets.xml. Not sure how or why but something is causing it to recreate these files. Which I didn’t think should happen. 🤷‍♂️

@james7342
Copy link
Author

james7342 commented Mar 4, 2021

I did find this in a file.

this.ExtraPlugins = "dnnpages,wordcount,notification";

Not sure how all this ties together. The editor is working which is good, just wished there was a clear understanding of how this all works. What should be default? dnnpages,wordcount,notifications? How are files getting created after their deleted? Does it use the values stored in the DB or does it use the files? If it uses the files then why write to the DB? And if it uses the DB why write the files? Can one reset and cleanup all the crud that’s seems to be left behind from the various changes and upgrades. What if the DNNCKeditor provider was uninstalled and reinstalled from the the upgrade/installation package?

@james7342
Copy link
Author

Sorry if it seems like I'm beating possible a dead horse here. I worked on this some more and was able to get it to stop writing the non "Dnn.CK" versions of the files. It must of been in the DB some place. I went into the HTML GUI editor and clicked the remove site settings button. Once I did this the CKEditorSettings.xml, CKToolbarButtons.xml and CKToolbarSets.xml were no longer being created. I looked in the DB for something that was specifying these files prior and couldn't find it, but could have over looked it. I then proceed to re-add my custom settings in the GUI and everything seems to be working correctly now.

The DNN.CK* files in the portal folders are for default values only, I think. As a test I deleted /portal/0/Dnn.CKEditorSettings.xml. Went to the GUI/Editor Config and clicked save. Upon doing so it created the file plus updated the DB. So not sure of the complete logic here, but there is some connection. If they exist they're not updated with the save action is what I've found.

Another observation after removing the site settings value from the GUI. Upon reloading the GUI, I had a default value of "dnnpages" in the box of extraPlugins text box. Which now matches what I have in the /portal/_default/Dnn.CKEditorDefaultSettings.xml and also in /portal/0/Dnn.CKEditorSettings.xml file. There has to be some sort of reading of the files for default values. Maybe it tries to read /portal/0/Dnn.CKEditorSettings.xml and if it doesn't exist reads /portal/_default/Dnn.CKEditorDefaultSettings.xml. Sort of explains my above comments why I didn't think the GUI saves were doing anything. I was completely removing the values in the extraPlugins box and trying to save. Which updated the DB correctly but never really reflected in the GUI. Possibly on GUI reload they were being read back in from a xml file. Maybe it's per settings value. Check DB, if value doesn't exist read from file, else value doesn't exist in either use hard coded values in code. ????

To wrap up this novel......

I think some cleanup needs to happen. In some DNN version the default value was "extraPlugins="dnnpages"". Possibly around the 2017 timeframe as I have a file in /portal/_defaults on my Dnndev.me site with the timestamp. Looking in the 9.9.0 packages the default has been changed to "extraPlugins="dnnpages,wordcount,notification"". At what version that change was made? I'm not sure.

Cleanup:

  1. Defaults need to be cleaned up to remove "notification" as the plugin looks to be removed in the bundled 4.15.1 version. As noted in the various comments above, it seems to not only be in Dnn.CKEditorDefaultSettings.xml. It also appears to be in various sections of code.

Other observations/issues

  1. Issue 9.9.0 CKEditor config: Icon legend image files not found #4537 - Missing icons and images folders in DNNConnect.CKE folder.
  2. Looking in the Upgrade/Installation packages "/Install/Provider/DNNCE_FolderProviders_09.09.00_Install.zip. When you extract the zip file there is a 01.00.02.SqlDataProvider file that doesn't seem to get installed. At least it never has at any point on any of my upgrades. Including 2 sites running 9.9.0.

@TopCat6
Copy link

TopCat6 commented Mar 4, 2021

@james7342 Thanks for all your sleuthing. Sites that I started recently (2019 = DNN 8?) have only extraPlugins="dnnpages". I've change all my other sites and their Portals to be the just that. Hopefully, any new update to CKE will work smoothly now.

@anh-duc-le
Copy link

I have found this problem in 4 sites I upgraded from 9.8.0 to 9.9.0. Copying over the old 4.5.3 plugins fixed the problem for now. BTW, once newsarticleslinks was copied over, the same issue occurred for iframedialog. Copying over iframedialog fixed that with no more issues.

Can confirm that we had this same issue and solution in our site upgrade

@stale
Copy link

stale bot commented Jun 11, 2021

We have detected this issue has not had any activity during the last 90 days. That could mean this issue is no longer relevant and/or nobody has found the necessary time to address the issue. We are trying to keep the list of open issues limited to those issues that are relevant to the majority and to close the ones that have become 'stale' (inactive). If no further activity is detected within the next 14 days, the issue will be closed automatically.
If new comments are are posted and/or a solution (pull request) is submitted for review that references this issue, the issue will not be closed. Closed issues can be reopened at any time in the future. Please remember those participating in this open source project are volunteers trying to help others and creating a better DNN Platform for all. Thank you for your continued involvement and contributions!

@stale stale bot added the stale label Jun 11, 2021
@james7342
Copy link
Author

I think this is still an issue.

@stale
Copy link

stale bot commented Sep 21, 2021

We have detected this issue has not had any activity during the last 90 days. That could mean this issue is no longer relevant and/or nobody has found the necessary time to address the issue. We are trying to keep the list of open issues limited to those issues that are relevant to the majority and to close the ones that have become 'stale' (inactive). If no further activity is detected within the next 14 days, the issue will be closed automatically.
If new comments are are posted and/or a solution (pull request) is submitted for review that references this issue, the issue will not be closed. Closed issues can be reopened at any time in the future. Please remember those participating in this open source project are volunteers trying to help others and creating a better DNN Platform for all. Thank you for your continued involvement and contributions!

@stale stale bot added the stale label Sep 21, 2021
@valadas
Copy link
Contributor

valadas commented Oct 4, 2021

@james7342, this issue thread is very long and talks a lot about very specific pre-existing conditions, can you summarize how a developer can get into this kind of situation from scratch please so we can make this issue more actionable. Thanks.

@james7342
Copy link
Author

@valadas, Understand there was a lot of chatter on this. I think the issue could be duplicated in the future if there is/was another update to CKEditor that didn't validate the bundled plugins included (ExtraPlugins) with the new version. In this instance the issues was due to the code, configuration that at some point in the past configured an extra plugin(s) as the default. When CKEditor was upgrade from 4.5 to 4.15 the plugin wasn't included in the new bundle which caused the issue.

I would say from a development perspective though.

  1. Define what plugin(s) should be default. I understand this is user configurable but should "dnnpages" be a default, or should it be "dnnpages,wordcount,notification", or something else? The configuration of how to configure CKeditor in DNN is not really documented and I don't feel the larger community in general is customizing it. I never had and ran into the issue.

  2. Clean up code and configuration files to remove plugins not required on fresh installs as determined in step 1. As noted in the thread I found references to places in code that possibly would try to configure CKEditor incorrectly. "this.ExtraPlugins = "dnnpages,wordcount,notification"; ". Of course it didn't seem to really set anything properly though.

  3. The CKEditor installation folder includes a bunch of plugins. Should it if they're not being used by DNN? If they're not default should they be included with the package?

  4. 01.00.02.SqlDataProvider included in the bundle never seems to get applied during installation. Should it?

  5. Possibly some sort of installation validation during CKEditor upgrade to indicate ExtraPlugin detected that is no longer installed or included in current CKEditor upgrade. With possible option on how to fix or offer to remove reference for the user.

  6. I don't think there is a clear understanding which configuration file(s), code etc. really defines what the configuration should be or how it's applied. There are DNN.CKEditor*.xml, CKEditor*.xml files, DB Settings and settings being done in code. Which values get applied and during what conditions or when? If they're not applicable then clean up code to prevent them from being created.

I think someone really needs to open the hood and take a hard look at all of it. I'm not sure there is really a clear understanding of the CKEditor implementation in DNN. What configuration is applicable, what isn't? What is required what isn't? How is the CKEditor getting configured? Is it configuration XML files, DB, Code? As noted in the thread I found varies settings in DB and other various files that may or not be duplicated.

I tried to cover some of the specific's in the post linked below, but the whole thread also highlights some of the challenges I had to trying to clean things up.
#4536 (comment)

@valadas
Copy link
Contributor

valadas commented Oct 4, 2021

I know I don't use extra plugins and I am assuming an upgrade does not remove existing ones as far as I know. I'll move this into a discussion until we can get a clear story that a developer can pick up to implement a fix.

@dnnsoftware dnnsoftware locked and limited conversation to collaborators Oct 4, 2021
@valadas valadas closed this as completed Oct 4, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

6 participants