DataFormPostSummary: fix different useSelect returned values #79478
Conversation
|
Size Change: -37 B (0%) Total Size: 7.51 MB 📦 View Changed
|
|
@ntsekouras, can you share a bit more detail on why we need to "complex" data fetching here? |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
What do you mean? Does it look more complex now? By making the returned extra entities in a flat object we gain the With your comment though I noticed that |
97e0ad9 to
1088cf7
Compare
1088cf7 to
efa9803
Compare
|
After the split, I know this is a more complex implementation of the Apologies for rambling; these thoughts are somewhat related. It's not a blocker, but it's worth considering. P.S. Going to test this in a few and approve for merging properly. |
Yeah, I definitely agree here! In the future we need to figure out a good API to properly support multi-entity forms and consumers shouldn't have to do anything like this. This exists right now only because of the lack of API, and the thing we gain is that the |
Mamaduka
left a comment
There was a problem hiding this comment.
Can confirm that warnings are no longer triggered.
In the future we need to figure out a good API to properly support multi-entity forms and consumers shouldn't have to do anything like this.
Do we have a tracking issue for similar enhancements?
We have various issues for such enhancements, although I don't think we have a specific issue for this yet. The reason I'm not yet creating one is because the focus is elsewhere right now (extensibility) and I want to properly investigate what to suggest in that issue. It's probably something we need in core, but I need to explore other use cases for example to see what makes more sense to suggest. In core right now this is the only case we have (home/index template). |
What?
Follow up of: #76934
The linked PR introduced a warning for returning different values in
useSelect:Non-equal value keys: entityData, entityIds. This PR solves that.Testing instructions
Editor Inspector: Use DataFormexperiment.useSelectwarning should be shown and editing should work exactly as beforeUse of AI Tools
Opus 4.8 with direction, changes and review