-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OnDisplaying in custom ShapeTableProvider does not populate data anymore in some cases #16673
Comments
@Habbni, are you by any chance using caching for your shapes? We encountered an issue where the initializer (e.g., I believe this change in behavior might be what you're experiencing. |
@sebastienros I have not tried to reproduce the issue. But just point out I don't see us using cache: OrchardCore/src/OrchardCore.Modules/OrchardCore.Contents/Drivers/ContentOptionsDisplayDriver.cs Line 35 in 4f5cd18
|
@sebastienros can you please take a look at this during triage please? |
We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues). This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here. |
@sebastienros so that last PR fixed something and broke another. |
I will debug to understand what is failing, or if the usage described in this issue is that actual problem and another event should have been used. |
Thanks @Habbni for confirming that quickly, very helpful. |
I tried the other events as well. But since it was before posting this issue and my brain reached it´s 2bit capacity, I´m not sure if i remember correctly: only OnDisplayed came up with data, which seemed too late for adding an alternate.. |
Correct.
I moved the initialization in Processing on the commit you pointed out. I probably should have put it in Displaying since it should not be called on Cache either. Then it will only be a matter of which "Displaying" is called first. |
What I did for now is invoking the code from Initialize as the first thing done in Update: Events are invoked from sources in this order: So even with my local change, because @Habbni 's code is in a shape table provider, the initialization code is executed too late. I will need to revert my PR (not technically but revert the change) and update the notification init code to run in Processing. |
@Habbni sis you get a chance to test out the latest preview? There was a follow up fix after that PR that we thought fixed your issue. Please try out the latest preview. Thank you |
Describe the bug
after upgrading from v1.8.3 to the current build, we can no longer use a custom ShapeTableProvider to add missing alternates for the shape ContentsAdminListCreate using following pattern:
This worked perfectly and it still does for almost any other shape, so we suspect this to be unintended.
With the current preview-2.0.0, or running latest main, context.Shape does not contain any of the shape/model data.
In this case, for example CreatableTypes and SelectedContentType remain empty.
It seems to only affect those shapes created using Initialize, like in this case:
Initialize<ContentOptionsViewModel>("ContentsAdminListCreate", m =>
Shapes created without Initialize still get their properties populated, for example this one:
results.Add(Shape("ContentsButtonActions_SummaryAdmin", new ContentItemViewModel(contentItem)).Location("SummaryAdmin", "ActionsMenu:10")
Orchard Core version
2.0.0-preview-18331
To Reproduce
Steps to reproduce the behavior:
Expected behavior
We would expect to see context.Shape properties to be populated, like it used to do, and like it still does when adding (for example) the following to the ShapeTableProvider:
The text was updated successfully, but these errors were encountered: