Closed rustyswayne closed 9 years ago
Follow up - Looks like a little caching issue. In my case, I had the headline originally on the Home content type and needed to use it on several other pages so I created the second content type "LandingPageHeading" to use in a composition for several other pages.
Doing this straight through the back office does not update the mapping but once the application pool resets, everything works as expected.
Thanks @rustyswayne, I'll take a look. Sounds like we're aggressively caching. I'll keep you posted.
@leekelleher @rustyswayne Agreed. Looks to me like this is the issue.
Making the Dictionary internal static and rebuilding it out in an event handler would probably do the trick.
Hi @rustyswayne I've been having a look at this again and I'm going to need a little bit more information to see what is going on and how best to avoid the issue.
As I understand it you were moving a property from your Home document type into a composite LandingPage document type. You did all this through the back office.
Were there any code changes to prompt a rebuild during this change?
I'm trying to figure out why the ApplicationStarting
event is not getting triggered if so.
Just having a look over our model-factory code to see what the issue might be, but I'm struggling to figure out what we're caching that could be effected by this?
In the DittoPublishedContentModelFactory
class, we have a private dictionary lookup called converterCache
, which contains a DocType alias and a Func<>
- in which the Func<>
is only a call to .As()
. So I can't see how changes to DocTypes in the back-office would affect this.
Ditto works purely from the IPublishedContent
object, not the DocType... so I'm unsure where the caching issue is happening.
@rustyswayne - do you still see this as an issue, or a glitch that happened during dev?
@leekelleher That matches my analysis so far also.
@JimBobSquarePants - sorry I missed your comment a week ago. In regards to ApplicationStarting event, all I did was to put a space in the web.config (and save) to check to see if it might be a run time cache issue.
@leekelleher Once I got the cache cleared I have not seen the issue again, albeit I have not made any changes either.
It may have been a glitch in dev ... if I see it again when I work with it next, I'll come back and comment on the issue.
Thanks @rustyswayne.
I'll set this issue as closed, then it can be reopened if happens again.
@rustyswayne No worries. If anything comes up again give us a shout.
I have a simple document type 'Home' which has no properties and I've included a 'LanndPageHeading' document type which defines a single property "headline" which does not appear to be mapped by Ditto.
I'm using the DittoPublishedContentModelFactory
Latest version from NuGet.