skybrud / Skybrud.Umbraco.Redirects

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

Skybrud redirect not listing items #200

Open emmashakespeare opened 2 months ago

emmashakespeare commented 2 months ago

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

13.0.4

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

13.2.2

Bug description

Skybrud is not able to list my redirects, I get the following error; angular.js:15697 TypeError: r.data.items.forEach is not a function at Default.js?d=2f68a502eb666d2065edc01f70be948181cb7808:181:22 at angular.js:18075:37 at m.$digest (angular.js:19242:15) at m.$apply (angular.js:19630:13) at k (angular.js:13473:36) at v (angular.js:13730:7) at y.onload (angular.js:13635:9) 'Possibly unhandled rejection: {}'

It seems lime the items that default.js is trying to call foreach on is an object, and not an array as it should be, but that is probably caused by an earlier issue.

I tried removing the table SkybrudRedirects and the row with value 'Umbraco.Core.Upgrader.State+Skybrud.Umbraco.Redirects' in umbracokeyvalue table as suggested in other thread (https://github.com/skybrud/Skybrud.Umbraco.Redirects/issues/152), but without success. When i restart the app locally the umbracokeyvalue has the value 4.0.9...

Any suggesstions?

abjerner commented 1 month ago

Hi @emmashakespeare

I'm not sure what could cause this, but this could be something like the issue described #179. Basically changing the JSON serialization options globally could affect the redirects package. The PR fixes the cases mentioned in the PR description, but I can't rule out that other changes to the global JSON settings could affect the redirects package.

So for starters, can you post back what is returned when accessing /umbraco/backoffice/Skybrud/Redirects/GetRedirects?. It's the endpoint used for the dashboard, so you need to already be logged into the backoffice in order to see it.

What I'd like to see from the endpoint is the general JSON format returned. Can you share the JSON here. The important part is the general structure and the property names, so feel free to blank out any property values that you don't feel confident sharing here on GitHub 😉

Also if you your setup involved changing the global JSON settings, could you share the steps involved for doing so here?

The state in the key value table should matter. The version number there reflects the last database migration executed by the package, which was 4.0.9. There has been any migrations in a while since the database table hasn't changed, so it will still say 4.0.9 even if you're on a much newer version.