I use the Cora theme for a website, Redux plugin seems mandatory for that.
I have several bugs in my WP backend (frontend works just fine):
If you deactivate the Cora Theme, everything works fine, if you deactivate the Redux plugin everything works fine too, so I guess one of these two are the problem.
Theme and plugin are both up to date.
Thanks for your help!
]]>That API was updated five years ago. As a suggestion, it may need to be updated as I cannot support your users or update your theme. I must keep referring them back to you. A quick search and replace of your code base would solve this. Please consider doing it soon so your users are supported and not coming to me to fix something I cannot.
Thanks!
]]>My widget calls wp.data.dispatch('core').saveUser({ … })
and creates a new user.
I’m not sure how I can “update” the list of authors in the Author dropdown so that the newly created user is loaded there.
I tried callingawait wp.data.dispatch('core').invalidateResolutionForStore('core')
wp.data.dispatch('core/editor').editPost({author: newUserId})
But this leads to the fact that the new user ID is set BEFORE the list of available users is updated.
]]>Thanks!
]]>I have used the same exact pattern for my store that is in the WordPress Core Data store. Note that I have created console.log messages to track both the current position of execution as well as to provide placeholders for additional functionality. The code follows:
import { addQueryArgs } from "@wordpress/url";
import apiFetch from "@wordpress/api-fetch";
export const getTable =
(id) =>
async ({ dispatch }) => {
console.log(' ...Resolver - Before fetch');
try {
const path = addQueryArgs('dynamic-tables/v1/table?tableId=' + id);
console.log(' ...Resolver - API Call - ' + path);
const table = await apiFetch({ path });
console.log(' ...Resolver - After fetch - returned table - ' + JSON.stringify(table));
console.log(table);
dispatch.receiveTable(table, id);
} catch (error) {
console.log(' ...Resolver - async error - ' + error);
}
console.log(' Resolver - async completed');
}
One thing I have noted is that some (but not all) core resolver definitions include a scheme to support “lock/unlock”. I have not included this because that code is marked not only as experimental, but labeled in such a way that suggests it is guaranteed to break on upgrades.
I would be very appeciative of any help that can be provided, either by way of something to add OR in suggesting an alternate development pattern. Any changes I would make would be trying to find a needle in a haystack because I don’t know the cause of the renders. It could be that my code does not implement React/Redux properly. However, I think it more likely that there are things going on within the Editor that, when combined with my store, create unknown side effects.
]]>or INSTEAD of Gutenberg?
Thx!
]]>