umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.49k stars 2.69k forks source link

RTE link picker throw error after upgrade to 7.15.0 / 8.1.0 #5849

Closed bjarnef closed 5 years ago

bjarnef commented 5 years ago

After upgrading af site on Umbraco Cloud from 7.12.4 to 7.15.0 to RTE link picker seems to throw an 417 (Missing token) error.

The link does however seems to work on frontend.

image

bjarnef commented 5 years ago

I guess this method should have an overload for Udi and maybe Guid as well? https://github.com/umbraco/Umbraco-CMS/blob/v7/dev/src/Umbraco.Web/Editors/EntityController.cs#L286-L291

or in Angular it need to convert it to an int id and since it use the udi from here https://github.com/umbraco/Umbraco-CMS/blob/4733256ca1bfb49d4fe946110e734db1351f81d9/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/linkpicker/linkpicker.controller.js#L66

bjarnef commented 5 years ago

It seems in only hit this method first time where it send a request like this: /umbraco/backoffice/UmbracoApi/Entity/GetUrlAndAnchors?id=1129

When your afterwards edit the link it send this request: /umbraco/backoffice/UmbracoApi/Entity/GetUrlAndAnchors?id=umb://document/afcc3d4df40d4d1eb8f2c43fdc592b58 which return the 417 (Missing token) error.

https://github.com/umbraco/Umbraco-CMS/blob/v7/dev/src/Umbraco.Web/Editors/EntityController.cs#L285-L291

I guess it is also an issue in v8: https://github.com/umbraco/Umbraco-CMS/blob/v8/dev/src/Umbraco.Web/Editors/EntityController.cs#L290-L296

bjarnef commented 5 years ago

In media picker there is something similar to use udi or id. https://github.com/umbraco/Umbraco-CMS/blob/4733256ca1bfb49d4fe946110e734db1351f81d9/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/mediapicker/mediapicker.controller.js#L97

The GetById overload methods doesn't have the attribute [HttpGet] and the parameter attribute [FromUri]: https://github.com/umbraco/Umbraco-CMS/blob/853087a75044b814df458457dc9a1f778cc89749/src/Umbraco.Web/Editors/EntityController.cs#L285-L321

Furthermore it seems to have something special to handle the different parameter types: https://github.com/umbraco/Umbraco-CMS/blob/853087a75044b814df458457dc9a1f778cc89749/src/Umbraco.Web/Editors/EntityController.cs#L72

bjarnef commented 5 years ago

The issue also exists in v8, but a bit different console error and status code. I will have a look at it.

image

bjarnef commented 5 years ago

Ahh, it seems you also have applied the changes in v8. Great, thanks @Shazwazza 👍

stefanoberetta commented 4 years ago

Sorry for bothering, is this issue resolved for 7.15.x versions? My 7.15.3 applications still have this behaviour.

Thank you S

drangus commented 4 years ago

Have had to manually apply PR #5881 at 7.15.3 ! A

callumbwhyte commented 1 year ago

Also still causing us problems in latest v7...

It seems this never actually got released, as it was reverted (I'm guessing accidentally) in f0fb371

Only way around now is to patch yourself :-(

nul800sebastiaan commented 1 year ago

Ah that is very unfortunate.. sorry about that, have removed the v7 label now. Unfortunately we're currently only providing security fixes for v7, so this will be a known issue for the rest of the duration for v7.

callumbwhyte commented 1 year ago

Thanks @nul800sebastiaan! At least it's clear now :-)