kgiszewski / Archetype

Archetype is an Umbraco 7 property editor that wraps other installed property editors.
https://github.com/kgiszewski/ArchetypeManual
MIT License
89 stars 54 forks source link

Label Templates Not Fully Resolving in Umbraco 7.4.3 #432

Closed Nicholas-Westby closed 6 years ago

Nicholas-Westby commented 6 years ago

Not entirely sure what's going on here, but I thought I'd make you aware of it:

widgets

You can see that parts of the label templates are showing up, but the dynamic portions are not (i.e., the parts I've circled should show the value of properties).

Some theories before I dig into this too much:

That's all that I can think of at the moment off the top of my head. Might have some time this weekend to dig into this.

FYI, the label templates all look something like this:

[Banner] {{labelIgnored}}

The "labelIgnored" is a plain text property.

Archetype 1.17.0. Umbraco 7.4.3. Upgraded Archetype with NuGet from 1.15.1. Cleared all server and client caches.

Nicholas-Westby commented 6 years ago

Here's what those look like after I downgrade to Archetype 1.15.1:

downgraded-widgets

Nicholas-Westby commented 6 years ago

Another theory: I have multiple Archetype properties on this page. Could be that they are interfering with each other.

kgiszewski commented 6 years ago

Lemme know what you find out.

Nicholas-Westby commented 6 years ago

I think the problem started with this commit: https://github.com/kgiszewski/Archetype/commit/3a2190b232862d6e791145a9e99ad247bcd4eb31#diff-f9dc560ec686175ddc2f121b9206e18cR550

This was the old logic:

var label = getNativeLabel(datatype, templateLabelValue, scope);
if(label) {
    templateLabelValue = label;
}

Essentially, if the there is a value returned from getNativeLabel, it would be used; otherwise, the rawValue (set a few lines above) would be used instead.

With the new code, the value from getNativeLabel is always used, even if it returns nothing.

I'll see if I can get a quick fix working (may be as simple as reverting a few lines to the old code) and submit a pull request.

Nicholas-Westby commented 6 years ago

Pull request here: https://github.com/kgiszewski/Archetype/pull/433

DanDiplo commented 6 years ago

Just to mention I'm seeing this in latest Umbraco 7.7.1 - after upgrading Archetype all label templates have disappeared. I applied Nicholas's fix and it worked, so gets a vote from me!

kgiszewski commented 6 years ago

@DanDiplo Thanks for the feedback and appreciate the support. I'm gonna close the issue as @Nicholas-Westby 's PR was merged this morning.

kgiszewski commented 6 years ago

@Nicholas-Westby @DanDiplo Published: https://www.nuget.org/packages/Archetype/1.17.1

May take a few minutes to index on Nuget.

Nicholas-Westby commented 6 years ago

Sweet! I'll give it a test once the NuGet index is up to date.

DanDiplo commented 6 years ago

Thanks, Kev, for your quick work - and Nicholas for your work.

Nicholas-Westby commented 6 years ago

Seems to be working!