Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nandoh 32 posts 104 karma points
    Mar 07, 2017 @ 13:39
    Nandoh
    0

    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:

        <td align="left" class="textContent">                                                                                
        <h3 style="color:#FFFFFF;">Lorem ipsum dolor.</h3>
        <div style="text-align:left;font-family:Tahoma,Verdana,sans-serif;font-size:14px;margin-bottom:0;color:#FFFFFF;line-height:135%;">
        <p>&gt; <a style="text-decoration: none; color: white;" href="/en/something/#process" target="_blank" title="LW Process">Lorem ipsum dolor</a></p>
        <p>&gt; <a style="text-decoration: none; color: white;" href="mailto:[email protected]" title="Contact Us">Contact us</a></p></div>
    </td>
    

    After Render Tasks:

    <td align="left" class="textContent">                                                                                
    <h3 style="color:#FFFFFF;">Lorem ipsum dolor.</h3>
    <div style="text-align:left;font-family:Tahoma,Verdana,sans-serif;font-size:14px;margin-bottom:0;color:#FFFFFF;line-height:135%;">
    <p>&gt; <a style="text-decoration: none; color: white;" src="http://website.com/en/something/#process" target="_blank" title="LW Process">Lorem ipsum dolor</a></p>
    <p>&gt; <a style="text-decoration: none; color: white;" href="mailto:[email protected]" title="Contact Us">Contact us</a></p></div>
    

    There are 2 differences between these 2 HTML:

    1. 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;
    2. The href attribute of the tag in the HTML is replaced with 'src';

    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

  • Markus Johansson 1938 posts 5866 karma points MVP 2x c-trib
    Mar 08, 2017 @ 16:49
    Markus Johansson
    0

    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

  • Nandoh 32 posts 104 karma points
    Mar 08, 2017 @ 17:02
    Nandoh
    0

    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

  • Markus Johansson 1938 posts 5866 karma points MVP 2x c-trib
    Mar 08, 2017 @ 16:55
    Markus Johansson
    1

    I can confirm that this was a bug that was introduced in NS 2.1.6.

    Patch-release will come tomorrow.

    // m

  • Markus Johansson 1938 posts 5866 karma points MVP 2x c-trib
    Mar 09, 2017 @ 11:06
    Markus Johansson
    100

    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

  • Peter S 64 posts 106 karma points
    Mar 09, 2017 @ 14:12
    Peter S
    0

    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.

  • Markus Johansson 1938 posts 5866 karma points MVP 2x c-trib
    Mar 09, 2017 @ 14:35
    Markus Johansson
    0

    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

  • Peter S 64 posts 106 karma points
    Mar 09, 2017 @ 14:38
    Peter S
    0

    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.

  • Markus Johansson 1938 posts 5866 karma points MVP 2x c-trib
    Mar 09, 2017 @ 14:41
    Markus Johansson
    0

    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

  • Peter S 64 posts 106 karma points
    Mar 09, 2017 @ 14:47
    Peter S
    0

    Sure, here is the error when trying to 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()"}
    
  • Markus Johansson 1938 posts 5866 karma points MVP 2x c-trib
    Mar 09, 2017 @ 15:41
    Markus Johansson
    3

    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.

  • Nandoh 32 posts 104 karma points
    Mar 09, 2017 @ 18:10
    Nandoh
    0

    Hi Markus,

    Regarding the issue with href vs. src, I can confirm that it's fixed :)

    Thank you very much. Regards

  • Markus Johansson 1938 posts 5866 karma points MVP 2x c-trib
    Mar 15, 2017 @ 15:11
    Markus Johansson
    0

    Great! Thanks!

Please Sign in or register to post replies

Write your reply to:

Draft