Using version 7.6.5 I've run into an issue where sometimes content doesn't render out on the page at all (and sometimes returns null). This has only come up after a recent upgrade from 7.1. Below is an example of a media type that has image, textbox and richtext properties. I've inserted comments on what's working and what's not... and what's wonky.
@foreach (var bannerItem in Model.Content.HomepageBanner.OfType<HomepageBannerContent>()) {
foreach (var prop in bannerItem.Properties) {
// show me all the properties so i know i'm sane
Print.ToPage(prop.PropertyTypeAlias);
}
<div class="slide">
<div class="slide-text">
<h2>
@* textbox content shows perfectly *@
@bannerItem.ContentTitle
</h2>
@* richtext content doesn't show *@
@bannerItem.ContentText
@* richtext outputs raw tostring converting html tags to html entities. i.e. literally <p>i am text</p> *@
@bannerItem.GetPropertyValue("contentText")
</div>
<div class="slide-image">
@* works perfectly *@
<img src="@bannerItem.BackgroundImage.Url" />
</div>
</div>
}
I've been using umbraco for a while now (2 years at least, I forget :) but I can't recall having this many issues since I first started. I can't isolate if it's because of the upgrade (i.e. data not coming up correctly) or I'm just having a series of brain farts. Any help would be appreciated.
Also, if it helps, I am using visual studio 2017, did the upgrade through nuget (with a temporary upgrade to 7.3 from 7.1 to 7.6.5) and have the following setting in my web.config so I can get at my models whilst programming:
In Umbraco 7.6.x there were some breaking changes so look into those, maybe check the EnablePropertyValueConverters value in the umbracoSettings.config file is not causing you a problem.
This was very helpful and gave me some ideas of what to look into but unfortunately, the problem persists. My currrent plan is to use the following as less than ideal workaround:
I hate to point out the obvious, but have you tried to make a change to the doctypes so that your Models DLL get regenerated?
Also, in 7.6 there are new propery converters for .GetPropertyValue(). I read somewhere that those propery converters are only available on new installations and not upgrades. See this change.
In dev, I use LiveDLL mode to get at the models in visual studio... but this is using the content service so that doesn't help anyway because it accesses the nodes in a different, potentially unpublished, way.
As far as the new property converters, maybe I can flip this back and forth a bit and experimentate.... just wondering if anyone else has already figured this out.
Media/content output issues
Using version 7.6.5 I've run into an issue where sometimes content doesn't render out on the page at all (and sometimes returns null). This has only come up after a recent upgrade from 7.1. Below is an example of a media type that has image, textbox and richtext properties. I've inserted comments on what's working and what's not... and what's wonky.
I've been using umbraco for a while now (2 years at least, I forget :) but I can't recall having this many issues since I first started. I can't isolate if it's because of the upgrade (i.e. data not coming up correctly) or I'm just having a series of brain farts. Any help would be appreciated.
Also, if it helps, I am using visual studio 2017, did the upgrade through nuget (with a temporary upgrade to 7.3 from 7.1 to 7.6.5) and have the following setting in my web.config so I can get at my models whilst programming:
What are your log files saying?
In Umbraco 7.6.x there were some breaking changes so look into those, maybe check the
EnablePropertyValueConverters
value in theumbracoSettings.config
file is not causing you a problem.Simon
Oh, also... log files look normal as far as I can tell. No errors.
This was very helpful and gave me some ideas of what to look into but unfortunately, the problem persists. My currrent plan is to use the following as less than ideal workaround:
Even more odd, is how the code below is outputting... I would expect a GetPropertyValue
Any other ideas of what to check to make sure everything works as intended (using bannerItem.ContentText)?
Code example:
Output:
Any new thoughts?
I hate to point out the obvious, but have you tried to make a change to the doctypes so that your Models DLL get regenerated?
Also, in 7.6 there are new propery converters for .GetPropertyValue(). I read somewhere that those propery converters are only available on new installations and not upgrades. See this change.
In dev, I use LiveDLL mode to get at the models in visual studio... but this is using the content service so that doesn't help anyway because it accesses the nodes in a different, potentially unpublished, way.
As far as the new property converters, maybe I can flip this back and forth a bit and experimentate.... just wondering if anyone else has already figured this out.
is working on a reply...