Can anyone explain to me the following messages I get from my razor macros in the trace:
Checking the RazorDataTypeModelTypes cache to see if the GUID 67db8357-ef57-493e-91ac-936d305e0f2a has a Model... GUID [id] does not have a DataTypeModel - falling back to ConvertPropertyValueByDataType.
Should I be concerned? I noticed on one macro where it navigates the tree looking for the closest property to be set, this was taking quite a long time (nearly a second) and was wondering if I could be doing in a way for better performance. FYI the code:
var metaDesc = Model.AncestorsOrSelf().Where("metaDescription.ToString() != string.Empty").Last().metaDescription;
where I look for the closest node that has the metaDescription tag set.
SO back to my original posting - does it matter that my properties do not have a DataTypeModel? Shouild I be including a 'using' or inherits in my macro scripts to help performance?
The "true" here tells GetPropertyValue to look up recursively and should do exactly what you're trying to do (and should be quite a bit more efficient).
Thanks for your help Sebastiaan. Unfortunately your code does not work for me. It returns the value OK when the property has a value on the current node. But if it does not have a value, it does not recurse up the tree to find the nearest ancestor with a value.
To clarify, my document type DOES contain a property with Alias metaDescription (it is a property on a master document type).
What I need to do is check if that property has a value. If it does, use it, but if it doesnt, traverse up the tree to find the nearest ancestor with value.
Anyway, to be able to help, I would need some more info, have you tried GetPropertyValue for example (that should just give a string back and not cause any problems)? What are you trying to do anyway, and what is the REAL problem (as said, this is just a warning message, not an actual error).
Razor messages in trace
Can anyone explain to me the following messages I get from my razor macros in the trace:
Checking the RazorDataTypeModelTypes cache to see if the GUID 67db8357-ef57-493e-91ac-936d305e0f2a has a Model... GUID [id] does not have a DataTypeModel - falling back to ConvertPropertyValueByDataType.
Should I be concerned? I noticed on one macro where it navigates the tree looking for the closest property to be set, this was taking quite a long time (nearly a second) and was wondering if I could be doing in a way for better performance. FYI the code:
var metaDesc = Model.AncestorsOrSelf().Where("metaDescription.ToString() != string.Empty").Last().metaDescription;
where I look for the closest node that has the metaDescription tag set.
SO back to my original posting - does it matter that my properties do not have a DataTypeModel? Shouild I be including a 'using' or inherits in my macro scripts to help performance?
No, it doesn't matter, the DataTypeModels are optional, it's just looking for them in case there is one.
To make your code a bit easier, try using this:
The "true" here tells GetPropertyValue to look up recursively and should do exactly what you're trying to do (and should be quite a bit more efficient).
Thanks for your help Sebastiaan. Unfortunately your code does not work for me. It returns the value OK when the property has a value on the current node. But if it does not have a value, it does not recurse up the tree to find the nearest ancestor with a value.
To clarify, my document type DOES contain a property with Alias metaDescription (it is a property on a master document type).
What I need to do is check if that property has a value. If it does, use it, but if it doesnt, traverse up the tree to find the nearest ancestor with value.
Hmmm, yes, I seem to be experiencing the same problem. I'll check it out and get back to you!
There was a bug fix in 4.7.1.1 (unreleased) that should correct this
Please try this build: http://dl.dropbox.com/u/2923715/LatestRazorMacroEngine-Only.zip
i have this problem too, i tried gareth solution, it doesn't work
anyone got a solution?
@Eran Have you tried replacing the macro engine dll with the one Gareth posted?
i tried it already and it didn't help, any thought what can i check ?
anyone can please explain the meaning of the messages ?
Sorry, I wasn't reading properly. The error (more of a warning, actually) means that it is looking for a RazorDataTypeModel for your datatype. To read more about RazorDataTypeModels scroll to the end of this blog post: http://umbraco.com/follow-us/blog-archive/2011/9/18/umbraco-razor-feature-walkthrough%E2%80%93part-7.aspx
Anyway, to be able to help, I would need some more info, have you tried GetPropertyValue for example (that should just give a string back and not cause any problems)? What are you trying to do anyway, and what is the REAL problem (as said, this is just a warning message, not an actual error).
is working on a reply...