Copied to clipboard

Flag this post as spam?

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

  • Niels Lynggaard 165 posts 452 karma points
    1 week ago
    Niels Lynggaard

    ParsePlaceHolders in custom workflow.

    Hi Guys.

    I'm slowly going nuts here..

    I've created a custom workflow that has a property (amongst others), "Message", that I want to parse values as normal.

    Somehow, this doesn't work! The "this.Message" property comes out as if it has allready parsed, since my property {firstName} isn't there.

    If I look at this.Workflow.Settings i can see that the property initially contains this text {firstName}.

    The record also has this property, but somehow it just isn't replaced.

    I've tried applying this.Message.ParsePlaceHolders(), and as far as I know this works used to work like a charm..

    Has something changed in relation to this? E.G are placeholders parsed "automatically" when I'm looking at the property this.Message inside my "Execute"-method?

    a bit of code:

         string withRazorView = record.ParseWithRazorView("~/views/partials/" + this.RazorViewFilePath); //does this parse placeholders as well?
     if (!String.IsNullOrEmpty(this.Message))
                    string s = this.Workflow.Settings.Where(x => x.Key == "Message").FirstOrDefault().Value; //contains the {firstName]
                    s = Umbraco.Forms.Data.StringHelper.ParsePlaceHolders(record, s); //seems to remove my placeholder
                    withRazorView = withRazorView.Replace("<!--##MESSAGE##-->", "<p>" + s.ParsePlaceHolders().Replace(Environment.NewLine, "<br />") + "<p>"); //just removes my placeholder

    I'm fairly sure this just "used to work", but somehow that isn't the case here..

  • Niels Lynggaard 165 posts 452 karma points
    1 week ago
    Niels Lynggaard

    Update. Some values come out, some doesn't. There must be a pattern.

    It seems, though, that it is allready parsed, when getting this.Message.

    Thank you, great community for beeing my "coding teddybear" :)

    Will update once fixed :)

  • Niels Lynggaard 165 posts 452 karma points
    1 week ago
    Niels Lynggaard

    Hmm... It seems that fields with names in more than one word doesn't really want to be replaced, even if I double-check the alias such as "navnPaaLedsager".

    I tried re-creating the form from scratch, and funnily enough, the SAME fields does come out ("name", "phone", "email") and the SAME fields doesn't come out "navnPaaLedsager"...

    I'm using forms 6.0.5 ... Anybody knows about any bugs that would cause this?

  • Anders Brohus 139 posts 355 karma points
    1 week ago
    Anders Brohus

    The bugs still around in 6.0.8 which is the latest we can upgrade, without upgrading Umbraco..

Please Sign in or register to post replies

Write your reply to: