umco / umbraco-vorto

1:1 multilingual property editor wrapper for Umbraco
https://our.umbraco.org/projects/backoffice-extensions/vorto
MIT License
44 stars 42 forks source link

Missing properties on wrapped grid editor in 7.3.5 causes grid rendering without content #36

Closed fraabye closed 8 years ago

fraabye commented 8 years ago

Hi Matt

I have been digging around the source for both Vorto and Core about this and I am still a bit uncertain about what causes the problem.

Steps to reproduce:

@using Our.Umbraco.Vorto.Extensions
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
    Layout = null;
}

@Model.Content.GetVortoValue("vortoTest")
<hr>
@Model.Content["gridTest"]

This renders these values for the same content. Note the missing properties on editor:

With Vorto

{ "name": "1 column layout", "sections": [ { "grid": 12, "rows": [ { "name": "Headline", "areas": [ { "grid": 12, "controls": [ { "value": "With Vorto", "editor": { "alias": "headline" } } ] } ], "id": "ba6a15a3-1153-299e-1aa8-6fa3915f8f88" } ] } ] }`

Without Vorto

{ "name": "1 column layout", "sections": [ { "grid": 12, "rows": [ { "name": "Headline", "areas": [ { "grid": 12, "controls": [ { "value": "Without Vorto", "editor": { "name": "Headline", "alias": "headline", "view": "textstring", "render": null, "icon": "icon-coin", "config": { "style": "font-size: 36px; line-height: 45px; font-weight: bold", "markup": "<h1>#value#</h1>" } } } ] } ], "id": "13c3e858-eb3f-8efd-df6e-3c9a63a4b924" } ] } ] }

The symptoms are described here http://issues.umbraco.org/issue/U4-7304 but it looks like you inherit from the needed PropertyValueEditorWrapper that should set the missing values? https://github.com/mattbrailsford/umbraco-vorto/blob/master/Src/Our.Umbraco.Vorto/Web/PropertyEditors/VortoPropertyEditor.cs#L89

Can you tell if this could be related to the converters mentioned here: https://github.com/mattbrailsford/umbraco-vorto/blob/master/Src/Our.Umbraco.Vorto/Extensions/IPublishedContentExtensions.cs#L130 or if it might be a core issue? I will be happy to submit a pull request, but haven't touched this part of the Umbraco codebase before.

Best regards

Frederik

mattbrailsford commented 8 years ago

Fixed in commit ed17096. When I wrote the code for grabbing the inner value and running the value converters, I couldn't find a way to seperate out the "default" vs the "specific" value converters so the issue here was that the "JsonValueConverter" was getting used rather than the "GridValueConverter". It turns out however there is already a method on the PublishedPropertyType that allows us to run converters which has already been filtered so there is no need for us to try an find the converter manually.

I've updated the code and pushed so there should be a new build on the build server shortly.

LasseKofoed commented 8 years ago

Hi Matt

I just tried to download the develop branch, and built it. Copied : Our.Umbraco.Vorto.dll to bin Our.Umbraco.Vorto\Web\UI\App_Plugins to App_Plugins

I stille get the issue raised in https://our.umbraco.org/projects/backoffice-extensions/vorto/bugs-feedback-suggestions/72474-working-with-grid-missing-attributes

I tried creating new a new contentpage, and recylingen IIS. But still the same, can you point me in a direction.

Best Regards Lasse Kofoed

fraabye commented 8 years ago

Hi Lasse

I updated using the nuget package on appveyor and it works as previously. Did you try clearing your cache and/or republishing? I might have cleared app_data to get it working.

Best regards Frederik