You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 and SavingItem events. It should also trigger the AddedVersion and SavedItem 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!
The AddedVersion and SavedItem 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
The text was updated successfully, but these errors were encountered: