Newsletter studio changes 'href' to 'src' in anchor tag
Hi Markus,
I've detected an unexpected behaviour using Newsletter Studio related to the way how NewsletterStudio replaces the relative Url's to be absolute Url's (I guess).
I'm using a CustomRenderTask, but it just does a token replacement, so I'm sure that this is not resulting of some mistake on my CustomRenderTask :)
I'm sharing part of the HTML of the newsletter and that same part of the HTML present in the renderResult.MessageBody (in the ProcessPreRender method) that I've logged to the umbraco's Log.
the relative URL (href="/en/something/#process" ) - that Umbraco's
RichTextEditor forces to be relative when it detects that the initial part of the
URL is the same as the domain - is changed to an absolute URL, what
makes me believe that your RenderTask are doing the job;
Regarding your question 'This does only apply if you are using a relative "hardcoded" link and not if you are linking to a page on the website right?' I'm not absolutely sure with what you mean by 'hardcoded link' and 'linking to a page on the website'.
In my case, a bit of that HTML is edited in the backoffice, using a richtexteditor and adding an hyperlink using the hyperlink option in the tinyMce....so I guess that for you this is the 'hardcoded link' that you've mentioned :)
Good to know that it was possible for you to replicate the issue.
I'll be waiting for tomorrow's patch-release.
I ran the installer in Umbraco. Installed fine. but then I got this error:
"ExceptionMessage":"Unrecognized attribute 'activateCssInliner' on this file: /umbraco/backoffice/NewsletterStudio/Settings/GetGeneralSettings/
That's why I removed the 'activateCssInliner' from the config, but I am now indeed getting errors when trying to send or preview.
/umbraco/backoffice/NewsletterStudio/SendContent/GetPreviewFor/1339
{"Message":"An error has occurred.","ExceptionMessage":"Value cannot be null.\r\nParameter name: type","ExceptionType":"System.ArgumentNullException","StackTrace":" at System.Activator.CreateInstance(Type type, Boolean nonPublic)\r\n at System.Activator.CreateInstance(Type type)\r\n at NewsletterStudio.Services.RenderTasks.RenderEngine.TaskFromType(String type)\r\n at NewsletterStudio.Services.RenderTasks.RenderEngine.GetRenderTasks()\r\n at NewsletterStudio.Services.RenderTasks.RenderEngine.RenderPreview()\r\n at NewsletterStudio.Umbraco.WebAPI.SendContentController.GetPreviewFor(HttpRequestMessage request, Int32 id)\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"}
Newsletter studio changes 'href' to 'src' in anchor tag
Hi Markus,
I've detected an unexpected behaviour using Newsletter Studio related to the way how NewsletterStudio replaces the relative Url's to be absolute Url's (I guess).
I'm using a CustomRenderTask, but it just does a token replacement, so I'm sure that this is not resulting of some mistake on my CustomRenderTask :)
I'm sharing part of the HTML of the newsletter and that same part of the HTML present in the renderResult.MessageBody (in the ProcessPreRender method) that I've logged to the umbraco's Log.
Before Render Tasks:
After Render Tasks:
There are 2 differences between these 2 HTML:
So, I'm wondering what is triggering that behaviour in any RenderTask of the NewsletterStudio.
Can it be an unexpected Regex in a RenderTask? I can't understand what's the reason for the href to be replaced with src.
Thanks in advance, Regards
Hi!
Thank you for posting this!
I can't say why but I can confirm that I can replicate this in the latest version of the package.
This does only apply if you are using a relative "hardcoded" link and not if you are linking to a page on the website right?
We will have to debug this a little more to figure out what is going on.
I'll keep you posted.
// m
Hi Markus,
Thanks for the quick reply and debug :)
Regarding your question 'This does only apply if you are using a relative "hardcoded" link and not if you are linking to a page on the website right?' I'm not absolutely sure with what you mean by 'hardcoded link' and 'linking to a page on the website'.
In my case, a bit of that HTML is edited in the backoffice, using a richtexteditor and adding an hyperlink using the hyperlink option in the tinyMce....so I guess that for you this is the 'hardcoded link' that you've mentioned :)
Good to know that it was possible for you to replicate the issue. I'll be waiting for tomorrow's patch-release.
Thank you. Regards
I can confirm that this was a bug that was introduced in NS 2.1.6.
Patch-release will come tomorrow.
// m
Hi!
Thanks for reporting this issue!
There is a new version out now please download from: http://www.newsletterstudio.org
Full release notes: http://support.newsletterstudio.org/customer/en/portal/articles/1053104-change-log
Haha, I just ran into this bug. Great timing. Thanks Markus.
Edit: I did have to remove the "activateCssInliner=true" part from the newsletterstudio.config file to get the updated version to work.
Talk about timing =D
Ohh, do you know if the inliner works? Did you run the installer? Did you get any errors etc?
Edit: It worked on my machine =D
I ran the installer in Umbraco. Installed fine. but then I got this error: "ExceptionMessage":"Unrecognized attribute 'activateCssInliner' on this file: /umbraco/backoffice/NewsletterStudio/Settings/GetGeneralSettings/
That's why I removed the 'activateCssInliner' from the config, but I am now indeed getting errors when trying to send or preview.
Hi!
I did replicate the error now, really strange. I'll keep you posted here.
Edit: Any error messages that you can share from when you are trying to send?
Edit2: Found the issue. Wrong bin-file in the build. Ohh. What a misstake. Says 2.1.5 right? I'll let you know when the right version is there.
// m
Sure, here is the error when trying to preview:
Hi!
Now there is a new build out. Please download from newsletterstudio.org or here at our.umbraco.org.
If you want to - just replace the NewsletterStudio.dll-file thats the only thing thats been changed.
Hi Markus,
Regarding the issue with href vs. src, I can confirm that it's fixed :)
Thank you very much. Regards
Great! Thanks!
is working on a reply...