skybrud / Skybrud.Umbraco.Redirects

Redirects manager for Umbraco.
https://packages.limbo.works/skybrud.umbraco.redirects/
MIT License
36 stars 41 forks source link

"All Sites" value is never selected in the ContentApp #194

Closed mdeslauriers-sigmund closed 5 months ago

mdeslauriers-sigmund commented 5 months ago

Which version of Skybrud Redirects are you using? (Please write the exact version, example: 4.0.8)

13.0.0

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

13.0.1

Bug description

When a redirection is created with the value "All sites" for the "Site" property, the ContentApp does not select the correct value when we open the edition panel.

Steps to reproduce

Expected behavior

The selected value should be "All sites".

Notes

The behaviour is the same if the redirection is created in the ContentApp. The combobox selected value is save correctly. When you go back to the dashboard, "All sites" is selected. It seems it's only the ContentApp panel in edit-mode that doesn't select the correct value after loading the redirection data.

I suspect the problem might be here : https://github.com/skybrud/Skybrud.Umbraco.Redirects/blob/4d080c3af6a28578dbedbf1e[…]d.Umbraco.Redirects/wwwroot/Scripts/Controllers/Editors/Site.js

abjerner commented 5 months ago

@mdeslauriers-sigmund good spot 👍

When investigating further, I think this issue has been there for a while without it being noticed - or at least reported.

The issue is indeed at the reference line, but also that the controller doesn't have access to checking whether the opened redirect is being added or updated. The referenced line should also have a check for whether the redirect is being added, as the selected site shouldn't be overwritten when editing an existing redirect.

I hope to have a fix out soon 😉

abjerner commented 5 months ago

This should now be fixed in the v13.0.3 release. @mdeslauriers-sigmund can you test and confirm?

mdeslauriers-sigmund commented 5 months ago

Hello @abjerner After updating the package to 13.0.3, the problem is gone and the ContentApp works ha expected Thank you very much for the fast reply and fix! 👍