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
What you were expecting:
I use a custom redirect on an edit form: We can edit a teaser from a list of teaser scheduling, and once saved we want to return to the list of scheduling.
For that we use a FormWithRedirect along with a function as a redirect prop.
What happened instead:
On submit, there is a first redirect toward the planned page, then immediately afterward a redirect toward "/" then finally toward the list.
Related code:
Until the 3.14.2 version this worked, but it broke on 3.14.3.
To be precise the bug was introduced by this commit #6145
The redirect created by useRedirect is called with undefined after the first redirect.
Before the change this resulted in a push toward { pathname: undefined } which was ignored.
Since the change in useRedirect this became: {pathname: "/", search: "", hash: ""} causing the bug.
Found the cause, I had a redirect props that did the redirect itself thus returning undefined.
Which in turn caused the bug when react-admin tried to use its return value.
Fixed it by having it return the url instead.
What you were expecting:
I use a custom redirect on an edit form: We can edit a teaser from a list of teaser scheduling, and once saved we want to return to the list of scheduling.
For that we use a FormWithRedirect along with a function as a redirect prop.
What happened instead:
On submit, there is a first redirect toward the planned page, then immediately afterward a redirect toward "/" then finally toward the list.
Related code:
Until the 3.14.2 version this worked, but it broke on 3.14.3.
To be precise the bug was introduced by this commit #6145
The redirect created by useRedirect is called with undefined after the first redirect.
Before the change this resulted in a push toward
{ pathname: undefined }
which was ignored.Since the change in useRedirect this became:
{pathname: "/", search: "", hash: ""}
causing the bug.Environment
The text was updated successfully, but these errors were encountered: