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
{{ message }}
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.
I have English and Espanol site in Craft CMS version 3.4.12
I add a new redirect and make sure it is for the English site.
When I save the new redirect, it adds it to the Espanol list of redirects but not for English as it should.
If I add a redirect and choose Espanol, it adds it to the English list, but still does not work properly.
Not sure why id is changing.
When I debug in SettingsController/actionSaveRedirect() function, the request param is correct.
And it get correct SiteId.
But after saving $res = Craft::$app->getElements()->saveElement($redirect, true, false);
siteId in elements_sites table changes to different id.
I also noticed that you have afterSave() function in elements/Redirect.php so checked it also.
// remove form other sites Craft::$app->getDb()->createCommand() ->delete('{{%elements_sites}}', [ 'AND', ['elementId' => $record->id], ['!=', 'siteId', $this->siteId] ]) ->execute();
Maybe above code changes some?
Not sure exactly. Hope to hear your idea! Please let me fix things asap.
Thanks.
The text was updated successfully, but these errors were encountered:
I can second this issue, I have a website in dutch and english and all my redirects are being saved in the english website. When I try to edit and save the redirect to the dutch version I get an 'Integrity constraint violation'
I have English and Espanol site in Craft CMS version 3.4.12
I add a new redirect and make sure it is for the English site.
When I save the new redirect, it adds it to the Espanol list of redirects but not for English as it should.
If I add a redirect and choose Espanol, it adds it to the English list, but still does not work properly.
Not sure why id is changing.
When I debug in SettingsController/actionSaveRedirect() function, the request param is correct.
And it get correct SiteId.
But after saving $res = Craft::$app->getElements()->saveElement($redirect, true, false);
siteId in elements_sites table changes to different id.
I also noticed that you have afterSave() function in elements/Redirect.php so checked it also.
// remove form other sites Craft::$app->getDb()->createCommand() ->delete('{{%elements_sites}}', [ 'AND', ['elementId' => $record->id], ['!=', 'siteId', $this->siteId] ]) ->execute();
Maybe above code changes some?
Not sure exactly. Hope to hear your idea! Please let me fix things asap.
Thanks.
The text was updated successfully, but these errors were encountered: