November Happy Hour will be moved to Thursday December 5th.

Error creating new global setting

Vote:
 

Hi there,

We recently upgraded the TinyMCE nuget package from 1.1.0.0 to 2.9.0.0 - Following the upgrade we were receiving the error below when attempting to create a new dropdown list via global settings (after hitting Save). 

To remedy the issue above I ran the following DB scripts (based on this):

UPDATE [dbo].[tblBigTableReference]
SET
ElementType = 'EPiServer.Cms.TinyMce.Core.TinyMceSettings, EPiServer.Cms.TinyMce, Version=2.9.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7'
WHERE ElementType = 'EPiServer.Editor.TinyMCE.TinyMCESettings, EPiServer.Cms.TinyMce, Version=1.1.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7';

UPDATE [dbo].[tblBigTable]
SET
ItemType = 'EPiServer.Cms.TinyMce.Core.TinyMceSettings, EPiServer.Cms.TinyMce, Version=2.9.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7'
WHERE ItemType = 'EPiServer.Editor.TinyMCE.TinyMCESettings, EPiServer.Cms.TinyMce, Version=1.1.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7';

Once the scripts executed, I tried to create a dropdown list again but I am now receiving the following error:

I was wondering if anyone has seen this issue before or if there are any ideas as to how I might resolve this?

Here is the relevant stack trace:

2019-11-05 14:41:18,220 [37] ERROR EPiServer.UI.Admin.EditPageTypeGlobalSettings: Error while saving property settings.
System.MissingMethodException: No parameterless constructor defined for this object.
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Activator.CreateInstance(Type type)
   at EPiServer.Data.Dynamic.Providers.Internal.DbDataStoreProvider.LoadObject(ProviderCallContext context)
   at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.<>c__DisplayClass31_0`1.<Execute>b__0()
   at EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute[TResult](Func`1 method)
   at EPiServer.Data.Dynamic.DynamicDataStore.InternalLoad(Identity id, Type type, LoadAsObjectType loadAs, ProviderCallContext parentContext)
   at EPiServer.Data.Dynamic.Providers.Internal.DbDataStoreProvider.LoadSubObject(Identity id, Type type, String storeName, ProviderCallContext context)
   at EPiServer.Data.Dynamic.Providers.Internal.DbDataStoreProvider.LoadReferencesAndCollections(ProviderCallContext ctx)
   at EPiServer.Data.Dynamic.Providers.Internal.DbDataStoreProvider.LoadObject(ProviderCallContext context)
   at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.<>c__DisplayClass31_0`1.<Execute>b__0()
   at EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute[TResult](Func`1 method)
   at EPiServer.Data.Dynamic.DynamicDataStore.InternalLoad(Identity id, Type type, LoadAsObjectType loadAs, ProviderCallContext parentContext)
   at EPiServer.Data.Dynamic.Providers.Internal.DbDataStoreProvider.LoadSubObject(Identity id, Type type, String storeName, ProviderCallContext context)
   at EPiServer.Data.Dynamic.Providers.Internal.DbDataStoreProvider.LoadReferenceMarkers(IList list, ProviderCallContext context)
   at EPiServer.Data.Dynamic.Providers.Internal.DbDataStoreProvider.LoadCollection(ProviderCallContext context, PropertyMap propertyMap)
   at EPiServer.Data.Dynamic.Providers.Internal.DbDataStoreProvider.LoadReferencesAndCollections(ProviderCallContext ctx)
   at EPiServer.Data.Dynamic.Providers.Internal.DbDataStoreProvider.LoadObject(ProviderCallContext context)
   at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.<>c__DisplayClass31_0`1.<Execute>b__0()
   at EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute[TResult](Func`1 method)
   at EPiServer.Data.Dynamic.DynamicDataStore.InternalLoad(Identity id, Type type, LoadAsObjectType loadAs, ProviderCallContext parentContext)
   at EPiServer.Data.Dynamic.Internal.EPiServerDynamicDataStore.Load[TResult](Identity id)
   at EPiServer.Data.Dynamic.Internal.DynamicDataCollection`1.DynamicDataCollectionEnumerator.get_Current()
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at EPiServer.Core.PropertySettings.Internal.PropertySettingsRepository.LoadGlobalsHolder()
   at EPiServer.Core.PropertySettings.Internal.PropertySettingsRepository.SaveGlobal(PropertySettingsWrapper global)
   at EPiServer.UI.Admin.EditPageTypeGlobalSettings.Save()
   at EPiServer.UI.Admin.EditPageTypeGlobalSettings.SaveButton_Click(Object sender, EventArgs e)

How would I know what object type the stack trace refers to, and if it is part of the core DLLs what can I do?

Cheers,
Tom.

EDIT: It definitely appears to be related to the configuration stored in the database. When I change the ElementStoreName I receive an Object reference error. Also, there doesn't appear to be any rows relating to TinyMce in my local Alloy database.

There are no rows in tblBigTable. However, here are the relevant rows from tblBigTableReference: 

pkId Type PropertyName CollectionType ElementType ElementStoreName IsKey Index BooleanValue IntegerValue LongValue DateTimeValue GuidValue FloatValue StringValue BinaryValue RefIdValue ExternalIdValue DecimalValue
672 2 PropertySettings NULL EPiServer.Cms.TinyMce.Core.TinyMceSettings, EPiServer.Cms.TinyMce, Version=2.9.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7 EPiServer.Editor.TinyMCE.TinyMCESettings 0 0 NULL NULL NULL NULL NULL NULL NULL NULL 673 NULL NULL
4418 2 PropertySettings NULL EPiServer.Cms.TinyMce.Core.TinyMceSettings, EPiServer.Cms.TinyMce, Version=2.9.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7 EPiServer.Editor.TinyMCE.TinyMCESettings 0 0 NULL NULL NULL NULL NULL NULL NULL NULL 4419 NULL NULL
4426 2 PropertySettings NULL EPiServer.Cms.TinyMce.Core.TinyMceSettings, EPiServer.Cms.TinyMce, Version=2.9.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7 EPiServer.Editor.TinyMCE.TinyMCESettings 0 0 NULL NULL NULL NULL NULL NULL NULL NULL 4427 NULL NULL
179522 2 PropertySettings NULL EPiServer.Cms.TinyMce.Core.TinyMceSettings, EPiServer.Cms.TinyMce, Version=2.9.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7 EPiServer.Editor.TinyMCE.TinyMCESettings 0 0 NULL NULL NULL NULL NULL NULL NULL NULL 179523 NULL NULL
#208922
Edited, Nov 05, 2019 3:18
Vote:
 

Have you tried uninstalling and reinstalling the TintMCE package?

#208926
Nov 05, 2019 4:17
Tom Burton - Nov 05, 2019 4:30
Hi Ravindra,

Yes, I have tried reinstalling the TinyMCE package with no luck.
Ravindra S. Rathore - Nov 05, 2019 4:39
Did you tried any other TinyMCE version? Like 2.0 etc.
Also try Update-EPiDatabase command in package manager console
Tom Burton - Nov 05, 2019 5:11
I tried 2.6.0, 2.6.5 and 2.8.0 but couldn't go any lower than 2.6.0 as the code relies on newer methods that were introduced.

I also tried running the Update-EPiDatabase command but it found no processes to run.
Ravindra S. Rathore - Nov 05, 2019 5:16
Oh ok then please try this scenario in fresh Episerver installation and if the error is still persist there then you can contact Episerver support.
Tom Burton - Nov 05, 2019 6:36
It will work in a fresh installation but I was hoping for some help diagnosing the issue.
Vote:
 

Do you have structure map configured for dependency resolving, in your solution?

https://www.codeart.dk/blog/2018/9/error-no-parameterless-constructor-defined-for-this-object/

#208932
Nov 05, 2019 7:15
Tom Burton - Nov 05, 2019 23:41
Hi Praful,

Thanks for the suggestion. We do have a StructureMap configured in the same way as specified in the URL you provided but this error still appears.
Vote:
 

UPDATE: After some trial and error I ran the following queries against the database to clear out the conflicting data (this data was around from the old version and pointing to the old object type located in a different namespace - I am surprised that this wasn't cleared out as part of upgrading to the new version, but I feel like others may run into this issue). I am yet to find any negative impact elsewhere on the site. 

delete
FROM [dbo].[tblBigTableReference]
WHERE elementstorename like '%tinymcesettings%'

delete 
FROM [dbo].[tblBigTableReference]
WHERE pkid in (select pkid
FROM [dbo].[tblBigTableIdentity]
WHERE StoreName LIKE '%TinyMce%') and propertyname = 'ToolbarRows';

EDIT: It seems like this error is inconsistent. My colleagues ran the above scripts but were still receiving errors. I found that not running the above scripts, but running the scripts below worked for my colleagues:

UPDATE [dbo].[tblSystemBigTable]
  SET
      String03 = 'EPiServer.Web.PropertyControls.PropertySettings.MultipleOptionsListSettings'
where String03 = 'EPiServer.Editor.TinyMCE.TinyMCESettings';

UPDATE [dbo].[tblBigTableReference]
  SET
      ElementType = 'EPiServer.Web.PropertyControls.PropertySettings.MultipleOptionsListSettings, EPiServer.Cms.AspNet, Version=11.11.2.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7'
where Elementstorename like '%tinymcesettings%';

DELETE 
FROM [dbo].[tblBigTableReference]
WHERE pkid in (select pkid
FROM [dbo].[tblBigTableIdentity]
WHERE StoreName LIKE '%TinyMce%') and propertyname = 'ToolbarRows';
#209012
Edited, Nov 06, 2019 6:49
Praful Jangid - Nov 06, 2019 8:23
It may be the part of breaking changes we haven't noticed. Good to see you resolved it. Great work.
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.