Replacing the AjaxControlToolkit HTMLEditor with FCKeditorV2 - (Medium Trust Issue Workaround)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
Hi Guys,

I managed to implement the workaround for the AjaxControlToolkit HTMLEditor "Medium Trust issue/Security Exception" by using "Change Set 57270" files. This should not affect the functionality of the application, the changes are only for the replacement o the AjaxControlToolkit HTMLEditor with FCKeditorV2.

Here are the steps you need to follow:
1. Download the following build: http://nopcommerce.codeplex.com/SourceControl/changeset/changes/57270

2. This ZIP file contains versions 1.40 to 1.80 and in the ZIP file there is a folder called trunk, which the folder that you need, the rest can be deleted except you will need to get the FCKeditorV2 DLL file from the dependencies folder in version 1.40.


3. After that go to the trunk/NopCommerceStore/editors and copy the FCKeditorV2 folder and copy it to your copy of nopcommerce editor folder.

4. Update your web.config file with the one from the trunk folder or use the diff tool provided to see what changes need to be made to the config file.

5. Now starting from trunk/NopCommerceStore/Administration/Modules/BlogPostInfo.ascx
Copy the pages (example copy each page by copying the .ascx, .ascx.cs  and .ascx.designer.cs) and go to your copy ( at the exact location where you copied the files in the trunk folder) and paste the files there, this will overwrite the existing ones. I would recommended doing this for all the pages as  not doing it for all the pages might cause errors while compiling the code due to the reference to the AjaxControlToolkit HTMLEditor being removed.

6. After replacing on the files, you should now be able to compile the project without any errors.

To replicate the "Medium Trust" issue on your local machine try adding:
<trust level="Medium"/> just before the </system.web> tag (Remove when deploying to live hosting)

I've deployed my application on my hosting server and it is working fine as far as I can tell.

I just wanted to share this, I hope someone will find this useful.

Here is a link to a screenshot: http://www.innobless.com/nopcommerce/FCKeditor_Replacement.jpg

P.S: Thanks to AndreyMaz for uploading these files.
P.P.S: Sorry for the bad English...

Disclaimer: I assume no responsibility regarding the accuracy of the information that is provided, use at your own risk

Good luck,
Chris
13 years ago
Hi,
First of all, you never have to apologize for “bad English”. In this forum (and most forums around the globe) there are people from all around the world. Nobody expects people from Greece, Spain, China, India, Pakistan, Vietnam, Cambodia, Russia and so on to have perfect English.

Heck, my wife is from Chile (we live in Sweden and I’m a “native Swede”) and if a language tutor would her here speak that person would have a heart attack.
But it works and nobody cares.

Now to your post.
That’s a great way of doing it. I did it another way.
1.  BACKUP
2.  Copy folder fckeditor (you can find it in a previous version) to the root.
3.  Register in webconfig. Put “<add tagPrefix="FCKeditorV2" namespace="FredCK.FCKeditorV2" assembly="FredCK.FCKeditorV2"/> under  tag  <controls>. In v 1.8 it should be somewhere around line 100 (depending on what other settings you have put in web.config).
4.  Replace all instances of (ctrl+shift+H):
   a.  “AjaxControlToolkit.HTMLEditor.Editor” with “FCKeditor”
   b.  ”nopcommerce:NopHTMLEditor” with ”FCKeditorV2:FCKeditor”
5.  Build the solution, you will get lots of errors saying that you need to register FCKeditor. On those places, position your cursor over “FCKeditor” and register it.
6.  You might need to remove “using AjaxControlToolkit.HTMLEditor”.
That should do it.
Remember to backup!
As always, I take no responsibility that this work for you.
13 years ago
[email protected] wrote:
Hi,
First of all, you never have to apologize for “bad English”. In this forum (and most forums around the globe) there are people from all around the world. Nobody expects people from Greece, Spain, China, India, Pakistan, Vietnam, Cambodia, Russia and so on to have perfect English.

Heck, my wife is from Chile (we live in Sweden and I’m a “native Swede”) and if a language tutor would her here speak that person would have a heart attack.
But it works and nobody cares.

Now to your post.
That’s a great way of doing it. I did it another way.
1.  BACKUP
2.  Copy folder fckeditor (you can find it in a previous version) to the root.
3.  Register in webconfig. Put “<add tagPrefix="FCKeditorV2" namespace="FredCK.FCKeditorV2" assembly="FredCK.FCKeditorV2"/> under  tag  <controls>. In v 1.8 it should be somewhere around line 100 (depending on what other settings you have put in web.config).
4.  Replace all instances of (ctrl+shift+H):
   a.  “AjaxControlToolkit.HTMLEditor.Editor” with “FCKeditor”
   b.  ”nopcommerce:NopHTMLEditor” with ”FCKeditorV2:FCKeditor”
5.  Build the solution, you will get lots of errors saying that you need to register FCKeditor. On those places, position your cursor over “FCKeditor” and register it.
6.  You might need to remove “using AjaxControlToolkit.HTMLEditor”.
That should do it.
Remember to backup!
As always, I take no responsibility that this work for you.



Thanks for the alternative solution Carl. I forgot to mention backup because I was just doing it as a test deployment.

Chris
13 years ago
I spent quite some time trying to get this to work, but kept ending up with tons of errors; I posted an alternative workaround here: https://www.nopcommerce.com/boards/t/5938/ckeditor.aspx#28697
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.