tomvanenckevort / Codery.TextCount

Umbraco data type which wraps existing text data type controls and shows text counts and limits while you type.
1 stars 3 forks source link

PropertyValueConverter returns "object" #11

Open hfloyd opened 3 years ago

hfloyd commented 3 years ago

Hi @tomvanenckevort 👋🏻

I use the API version of ModelsBuilder (latest - "Umbraco.ModelsBuilder 8.1.6"), and noticed that a TextCount wrapped RTE property is returning data as "object":

In the interface for the composition: image

In the class for a content type using that composition: image

I see there is a PropertyValueConverter in the package, so I'm not sure why this is the result...

tomvanenckevort commented 3 years ago

Yes, the PropertyValueConverter does seem to be recognized when rendering the values, but somehow it's not recognised by ModelsBuilder when generating the models. I'll do some debugging to see why that might be.

tomvanenckevort commented 3 years ago

The issue was that the GetPropertyValueType function of the PropertyValueConverter was using the wrong parameter type and not calling the correct type property of the wrapped data type property.

This has now been fixed in v2.0.5 which has been released on NuGet and Our.

hfloyd commented 3 years ago

Hi @tomvanenckevort , I think something related to the version is missing in the Our package - when I attempted to install it over the 2.0.4 version, I got "Package is already installed" message: image

I was able to successfully install the last one as an update over the 2.0.3 version.

...

I was able to install it via NuGet, but when I Build Models, it is still coming through as an "object".

tomvanenckevort commented 3 years ago

I forgot to update the version number of the new Our package. That has now been updated to the correct v2.0.5 on Our.

I'll reopen the issue and test the new version again here locally. It was working fine for me this morning, but I realise that was not through the API version you mentioned.

tomvanenckevort commented 3 years ago

I've retested this locally with the ModelsBuilder API mode and it generates the model with the correct type for me: image

So this is with:

The models were generated by adding a .mb file to the solution, right-click it in VS and click Build Models.

Is that the same setup you are using?

hfloyd commented 3 years ago

Hi @tomvanenckevort , Yes, that is the way I was generating the Models... I needed to move the project along, so I manually fixed the property type via an addition to the model file, but I can comment it out and try again....