Closed james7342 closed 3 years ago
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.
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.
@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.
Looks like it was part of the previous CKEditor provider
/*********************************************************************************************************/
/**
* 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'
} );
}
} );
} )();
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
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.
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.
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.
Which leads me to next question. How does this get cleaned up? Considering I never installed anything outside of doing DNN upgrades.
It's no problem @james7342, thanks for digging into this 😃
It looks like this plugin was removed via https://github.com/DNN-Connect/CKEditorProvider/pull/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.
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).
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.
It's in the GUI Config Editor..
Files in Portals\0
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.
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.
Looks like the settings are stored in the DB in table : CKE_Settings
In SQL I ran this, SELECT * FROM CKE_Settings Where SettingName LIKE '%Plugins'
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 🤷🏻♂️
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.
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.
Icons Issue: https://github.com/dnnsoftware/Dnn.Platform/issues/4537
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.
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.
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.**
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.
<Config ......extraPlugins="dnnpages">
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:
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
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?
@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">
@james7342 Ok, thanks. I'll give it a try.
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.
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.
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. :)
@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.
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. 🤷♂️
I did find this in a file. https://github.com/dnnsoftware/Dnn.Platform/blob/ec762ba9e38817bd74aa9be1ae144b8bde5a6dee/DNN%20Platform/Providers/HtmlEditorProviders/DNNConnect.CKE/Objects/EditorConfig.cs#L59
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?
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:
Other observations/issues
@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.
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
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!
I think this is still an issue.
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!
@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.
@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.
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.
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.
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?
01.00.02.SqlDataProvider included in the bundle never seems to get applied during installation. Should it?
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.
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. https://github.com/dnnsoftware/Dnn.Platform/issues/4536#issuecomment-790600696
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.
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
Error information
Affected version
Affected browser