Closed seankearney closed 9 years ago
Sitecore's response thus far is:
The
AddedVersion
andSavedItem
events are database specific. Because of the creating the item in memory without parent item, it does not appears in the database. That’s why you cannot see these events. If you want to see them, you have to create item with the parent
A potential workaround for this issue could be to override
the GlassController
's GetRenderingParameters
method.
public class CustomController : GlassController
{
protected override T GetRenderingParameters<T>()
{
// Sitecore bug 442839... we need to manually raise two events until the bug is fixed
// Field fallback bug - https://github.com/HedgehogDevelopment/sitecore-field-fallback/issues/18
// https://github.com/mikeedwards83/Glass.Mapper/issues/158
using (new Sitecore.Data.Events.EventDisabler())
{
return base.GetRenderingParameters<T>();
}
}
}
We are seeing that fallback isn't working after a call to GlassController.GetRenderingParameters()
Glass code goes and creates an in-memory Sitecore item via this and this
Basically – Glass goes and creates a fake, in memory, Sitecore item. This triggers events to be fired in Sitecore. Specifically it triggers the
AddingVersion
andSavingItem
events. It should also trigger theAddedVersion
andSavedItem
events; it does not fire the last two.The field fallback module responds to the Adding/Saving events and disables FieldFallback. When it sees Added/Saved it is re-enabled. Being we aren’t seeing the closing events Field Fallback stays disabled!
I’ve registered a bug with Sitecore #442839. Here is a simple script to duplicate Sitecore bug
cc: @mikeedwards83