Closed lmaucoin closed 5 years ago
Hi, I tried your solutions and it seems to work on first save of a redirect. However, when I try to edit and re-save an existing redirect, I get an error:
@janmeeus Thanks for finding that! I can have a look into this soon.
In the meantime, another fork of this repo at https://github.com/nyby/craft3-plugin-redirect by @nyby seems to address this same issue ... probably more eloquently.
@johanzandstra Thanks for the fix. When are you planning to make a new release with these adjustments?
@johanzandstra yes, also wondering when a new release with be posted to correct these issues. We are currently unable to save any redirects. Can you advise?
Waiting for it too
+1 for this one please. @johanzandstra
@johanzandstra Thanks for the fix. When are you planning to make a new release with these adjustments?
@johanzandstra I am running into the same issue, when is this being released? I see the last release was a year ago April, is this code still being maintained and when is the next release?
Hi, love the plugin! However, I recently upgraded to Craft 3.2.7 and have found that redirects are no longer saving on the correct sites.
I did some sleuthing and found that though the
$propagate
parameter is set to false when saving the redirect, this only stops it from being saved to all sites if the record exists (see Arguments here).To get around this, in the
afterSave
callback, all element records created for sites that aren't the relevant one are deleted. Unfortunately, this is run every time a record is saved (and it always gets saved for all sites when a new record is created), meaning that the only lingering redirect record is one on the highest site ID.This PR shifts the record deletion to occur in the Controller's action for saving instead of in a post-save callback, so it's only executed for the record on the relevant site.