Bug 1.1.3 - breaks 'Publish At' feature in Umbraco
On both 4.7 and 4.7.1 when using Embedded Content on a document type such as a page, if you set a "publish at" date time - it doesn't work.
Pages published fine manually.
The error logged is:
Error publishing node: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object. at TheFarm.Umbraco.EmbeddedContent.DataEditor.Initialize() at TheFarm.Umbraco.EmbeddedContent.DataEditor..ctor() --- End of inner exception stack trace --- 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) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at umbraco.cms.businesslogic.datatype.controls.Factory.GetNewObject(Guid DataEditorId) at umbraco.cms.businesslogic.property.Property.MakeNew(PropertyType pt, Content c, Guid versionId) at umbraco.cms.businesslogic.Content.createNewVersion() at umbraco.cms.businesslogic.web.Document.PublishWithResult(User u) at umbraco.presentation.publishingService.CheckPublishing(Object sender)
Any ideas? Looks like Embedded Content is throwing an exception and the publish process is bombing out?
Checked this out and it's definitely an issue with Embedded Content.
A document type instance that does not have an Embedded Content property publishes fine using the 'Publish At' feature, but w doc type that has a property using Embedded Media data type won't (and logs the above error).
(I also tested adding an Embedded Content property to a doc type that uses 'Publish At' fine, as soon as I do, 'Publish At' stops working and we get the error (as in original post) in the Umbraco log :( )
In DataEditor.cs, of the Initialize() method, at line 95 there's the following call to get the full path of the umbraco node service:
var filePath = HttpContext.Current.Server.MapPath("~/umbraco/webservices/UmbracoNodeNameService.asmx");
This value is then used to check that the service exists, etc, before anything else proceeds.
The call to HttpContext.Current works fine when you Publish a page manally - but when a page publish is triggered by the timer event (by using Publish At), there is no HttpContext.Current - it's null.
So this call fails, the exception bubbles up to the top of the stack and the page fails to publish.
A very simple (and tested) solution is to replace the MapPath call to a version that works regardless of a Context. So simply replace it with:
var filePath = HostingEnvironment.MapPath("~/umbraco/webservices/UmbracoNodeNameService.asmx"
Bug 1.1.3 - breaks 'Publish At' feature in Umbraco
On both 4.7 and 4.7.1 when using Embedded Content on a document type such as a page, if you set a "publish at" date time - it doesn't work.
Pages published fine manually.
The error logged is:
Error publishing node: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object. at TheFarm.Umbraco.EmbeddedContent.DataEditor.Initialize() at TheFarm.Umbraco.EmbeddedContent.DataEditor..ctor() --- End of inner exception stack trace --- 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) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at umbraco.cms.businesslogic.datatype.controls.Factory.GetNewObject(Guid DataEditorId) at umbraco.cms.businesslogic.property.Property.MakeNew(PropertyType pt, Content c, Guid versionId) at umbraco.cms.businesslogic.Content.createNewVersion() at umbraco.cms.businesslogic.web.Document.PublishWithResult(User u) at umbraco.presentation.publishingService.CheckPublishing(Object sender)
Any ideas?
Looks like Embedded Content is throwing an exception and the publish process is bombing out?
Checked this out and it's definitely an issue with Embedded Content.
A document type instance that does not have an Embedded Content property publishes fine using the 'Publish At' feature, but w doc type that has a property using Embedded Media data type won't (and logs the above error).
(I also tested adding an Embedded Content property to a doc type that uses 'Publish At' fine, as soon as I do, 'Publish At' stops working and we get the error (as in original post) in the Umbraco log :( )
+1 on this, I'm getting the same error when trying to publish using publish at on Documents with Embedded Content in. Running on 4.7.1.
Found the bug.
In DataEditor.cs, of the Initialize() method, at line 95 there's the following call to get the full path of the umbraco node service:
This value is then used to check that the service exists, etc, before anything else proceeds.
The call to HttpContext.Current works fine when you Publish a page manally - but when a page publish is triggered by the timer event (by using Publish At), there is no HttpContext.Current - it's null.
So this call fails, the exception bubbles up to the top of the stack and the page fails to publish.
A very simple (and tested) solution is to replace the MapPath call to a version that works regardless of a Context.
So simply replace it with:
var filePath = HostingEnvironment.MapPath("~/umbraco/webservices/UmbracoNodeNameService.asmx"
And it works fine :)
is working on a reply...