Skip to content

Instantly share code, notes, and snippets.

@richarth
richarth / 155100bd-c7a0-4a2b-a3f0-968dab9b189b.json
Created May 28, 2020 10:46
Example form and workflow giving null pointer exception upon submission with Umbraco Forms 7.4.1
{
"id": "906a4729-814f-4ee3-97f0-2abe5a9ec3af",
"name": "Send email when Submitted",
"form": "94175c62-a2eb-4472-be98-23c7739d6cce",
"active": true,
"workflowTypeId": "e96badd7-05be-4978-b8d9-b3d733de70a5",
"executesOn": "Submitted",
"settings": {
"Email": "website@example.com",
"SenderEmail": "{Email}",
@richarth
richarth / TestBase.cs
Created October 29, 2019 16:01
Cut down demo of a base class for our xUnit tests
using UCommerce.EntitiesV2;
using Xunit.Abstractions;
namespace Website.Tests
{
public class TestBase : XunitApprovalBase
{
protected TestBase(ITestOutputHelper output)
: base(output)
{
@richarth
richarth / BannerTests.cs
Created October 29, 2019 16:00
An example xUnit test where dispose is not called when running multiple tests at once.
using ApprovalTests;
using ApprovalTests.Namers;
using ApprovalTests.Reporters;
using ApprovalTests.Reporters.TestFrameworks;
using Moq;
using RazorGenerator.Testing;
using Umbraco.Core.Composing;
using Xunit;
using Xunit.Abstractions;
@richarth
richarth / gist:613e0e1850245e3ce7c7f927b3971184
Created October 8, 2019 10:12
Our.Umbraco.SuperValueConverters models builder error
Failed to build models.
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at Our.Umbraco.SuperValueConverters.Helpers.TypeHelper.<>c.<GetType>b__0_0(Assembly x)
at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at Our.Umbraco.SuperValueConverters.Helpers.TypeHelper.GetType(String typeName, String namespaceName)
@richarth
richarth / gist:b5ad28a9f9b783ceb25a2b93d69ed501
Created October 8, 2019 10:10
Our.Umbraco.SuperValueConverters error in Umbraco 7.15.3
2019-10-08 10:52:29,939 [P8668/D4/T17] ERROR Umbraco.Core.UmbracoApplicationBase - An unhandled exception occurred
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at Umbraco.Core.Cache.HttpRequestCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem)
at Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedContent.Get(XmlNode node, Boolean isPreviewing)
at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedContentCache.GetById(UmbracoContext umbracoContext, Boolean preview, Int32 nodeId)
at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedContentCache.DetermineIdByRoute(UmbracoContext umbracoContext, Boolean preview, String route, Boolean hideTopLevelNode)
at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedContentCache.GetByRoute(UmbracoContext umbracoContext, Boolean preview, String route, Nullable`1 hideTopLevelNode)
at Umbraco.Web.Routing.ContentFinderB
@richarth
richarth / error.txt
Created July 30, 2019 09:51
Our.Umbraco.SuperValueConverters front end error in Umbraco 7.15.1
[ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.]
Umbraco.Core.Cache.HttpRequestCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem) +288
Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedContent.Get(XmlNode node, Boolean isPreviewing) +155
Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedContentCache.GetById(UmbracoContext umbracoContext, Boolean preview, Int32 nodeId) +68
Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedContentCache.DetermineIdByRoute(UmbracoContext umbracoContext, Boolean preview, String route, Boolean hideTopLevelNode) +189
Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedContentCache.GetByRoute(UmbracoContext umbracoContext, Boolean preview, String route, Nullable`1 hideTopLevelNode) +202
Umbraco.Web.Routing.ContentFinderByNiceUrl.FindContent(PublishedContentRequest docreq, String route) +207
Umbraco.Web.Routing.ContentFinderByNiceUrl.TryFind
@richarth
richarth / error.txt
Last active July 30, 2019 09:50
Our.Umbraco.SuperValueConverters back office error in Umbraco 7.15.1
An error occured
Mapping types:
Content -> String[]
Umbraco.Core.Models.Content -> System.String[]
Destination path:
ContentItemDisplay.Urls.Urls
@richarth
richarth / error.txt
Created April 16, 2019 14:52
Error with Our.Umbraco.SuperValueConverters 1.1.0
Failed to build models.
Object reference not set to an instance of an object.
at Our.Umbraco.SuperValueConverters.ValueConverters.BaseValueConverter.<>c.<GetTypeForPicker>b__3_0(Type x)
at System.Linq.Enumerable.<>c__DisplayClass7_0`3.<CombineSelectors>b__0(TSource x)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at Our.Umbraco.SuperValueConverters.Extensions.IEnumerableExtensions.IntersectMany[T](IEnumerable`1 values)
at Our.Umbraco.SuperValueConverters.ValueConverters.BaseValueConverter.GetTypeForPicker(IPickerSettings pickerSettings)
at Our.Umbraco.SuperValueConverters.ValueConverters.BaseValueConverter.GetPropertyValueType(PublishedPropertyType propertyType, IPickerSettings pickerSettings)
at Our.Umbraco.SuperValueConverters.ValueConverters.MultiNodeTreePickerValueConverter.GetPropertyValueType(PublishedPropertyType propertyType)
@richarth
richarth / gist:400201d0e27d381d13c263850802e67b
Created March 8, 2019 16:50
SuperValueConverters front end error
2019-03-08 16:36:06,764 [P9180/D2/T15] ERROR Umbraco.Core.UmbracoApplicationBase - An unhandled exception occurred
System.NullReferenceException: Object reference not set to an instance of an object.
at Umbraco.Core.Cache.HttpRequestCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem)
at Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedContent.Get(XmlNode node, Boolean isPreviewing)
at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedContentCache.GetById(UmbracoContext umbracoContext, Boolean preview, Int32 nodeId)
at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedContentCache.DetermineIdByRoute(UmbracoContext umbracoContext, Boolean preview, String route, Boolean hideTopLevelNode)
at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedContentCache.GetByRoute(UmbracoContext umbracoContext, Boolean preview, String route, Nullable`1 hideTopLevelNode)
at Umbraco.Web.Routing.ContentFinderByNiceUrl.FindContent(PublishedContentRequest docreq, String route)
at U
@richarth
richarth / gist:bdaebe383c1e4a99f2af9def838701c2
Created March 4, 2019 11:33
Umbraco no ID on node error message
2019-03-04 11:27:35,480 [P1052/D2/T8] ERROR Umbraco.Web.Editors.EntityController - Unhandled controller exception occurred
System.InvalidOperationException: Node has no ID attribute.
at Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedContent.Get(XmlNode node, Boolean isPreviewing)
at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedContentCache.GetSingleByXPath(UmbracoContext umbracoContext, Boolean preview, String xpath, XPathVariable[] vars)
at Umbraco.Web.PublishedCache.ContextualPublishedCache`1.GetSingleByXPath(Boolean preview, String xpath, XPathVariable[] vars)
at Umbraco.Web.Editors.EntityController.GetByQuery(String query, Int32 nodeContextId, UmbracoEntityTypes type)
at lambda_method(Closure , Object , Object[] )
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instanc