-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error on List view mode #18
Comments
I found where the problem is. The code expects that there is a sort property, though it is not documented that it is required. The documentation states that...
It can be used as the default sort but if we do not do either SetNameProperty or SetSortProperty then the list view will fail. I think it should be explicitly stated in the documentation. I found out that the list view can work by using either of the two. The code that fails when no sort property is set is on line 59 in FluidityPropertyConfig > LambdaExpression. |
Thanks for debugging into this. I've pushed some code that no longer requires a sort property to be defined so you shouldn't get the error moving forward. The list view will require a NameProperty or NameFormat regardless, but I believe the docs are explicit enough on this front "Within Umbraco it is expected that an entity has a name property so we need to let Fluidity know which property to use for the name or if our entity doesn’t have a single name property, then how to construct a name from an entities other properties. We do this by using either the SetNameProperty or SetNameFormat methods on a FluidityCollectionConfig instance." |
I think it would be prudent here to add a more useful error message for the end user. One of the advantages of fluent configuration is that you can capture misconfigured or missing configuration at first run when processing the configuration and explicitly feedback. I do that a lot in UmbMapper. |
I encountered this error on a simple model having and Id (the PK in the database) and a Name of string type.
This is what my configuration looks like
The model
The error I got
I am on Umbraco 7.8.1 and Fluidity 1.0.1.
The text was updated successfully, but these errors were encountered: