rasmusjp / umbraco-multi-url-picker

Multi Url Picker for Umbraco 7
MIT License
31 stars 29 forks source link

Picked nodes are not resolved when deleted #51

Closed bjarnef closed 7 years ago

bjarnef commented 7 years ago

When having nodes picked that then are deleted are not resolved like with e.g. MNTP.

For example I have these links inside Archetype, but the nodes have been deleted.

image

When clicking the link (edit) it returns an error, because the node doesn't exists.

image

rasmusjp commented 7 years ago

Are the nodes deleted completely or are they still in the recycle bin?

bjarnef commented 7 years ago

They are completely removed.

Futhermore it also seems the multi-url picker has stopped working on Umbraco Cloud. I am not sure if it is an issue inside Archetype: https://github.com/kgiszewski/Archetype/issues/391 or just the multi-url picker.

It might be updates to Courier and/or Umbraco, e.g. when deploying from local to live environment, the live environment has the deployed data, but the node id's are the local ids. This can be moved to a new issue if it is related to your package.

rasmusjp commented 7 years ago

Ok, I think the removed links are only handled in the value converter, but we should also handle this in the backoffice. I'll take a look at it.

Regarding Umbraco Cloud, afaik you'll need the Courier provider, which must be manually compiled from the source right now.

bjarnef commented 7 years ago

Okay, thanks. We did something like this in UrlPicker package, so when a node it moved to recycle bin, backoffice doesn't display the nodes in the list - and I think that also handle nodes, which are completely removed. https://github.com/kgiszewski/uWestFest/blob/develop/urlpicker/app/scripts/controllers/url.picker.controller.js#L456-L463

You could also ensure a content or media id's exists before looking up the entity: https://github.com/rasmusjp/umbraco-multi-url-picker/pull/37/files https://github.com/kgiszewski/uWestFest/blob/master/urlpicker/app/scripts/controllers/url.picker.controller.js#L456-L457

I think it did handle deployment of the data correct previously... but maybe it only deployed the data and hadn't resolved the id's.. can't remember since it is a while ago and several updates to Umbraco and Courier have been rolled out since then.

Yes, or I can add the file to App_Code folder.. I think that would work too. https://github.com/rasmusjp/umbraco-multi-url-picker/blob/master/src/RJP.MultiUrlPicker.Courier/MultiUrlPickerDataResolverProvider.cs

have you considered adding the dll for the courie data resolver to the project page on Our like Archetype does? and maybe submit a PR to https://github.com/umbraco/Umbraco.Courier.Contrib ? :)

rasmusjp commented 7 years ago

I've just released v1.3.2 which should fix this. I'm not sure about removing recycled items since the MNTP doesn't do this either, so for now you'll still see items from the recycle bin in the backoffice.

Yeah, placing the file in App_Code should also work. Actually the Courier resolver is already in the contrib repo, see https://github.com/umbraco/Umbraco.Courier.Contrib/blob/dev/src/Umbraco.Courier.Contrib.Resolvers/PropertyDataResolvers/MultiUrlPickerPropertyDataResolver.cs

bjarnef commented 7 years ago

Thanks for the new release. Okay, haven't checked recently how MTNP handle this or the new content pickers in v7.6.0 .. it might make sense to keep them in the picker, but it would be nice they visually differs from the other elements since tehy won't be rendered in frontend and might confuse editors.

Okay, already have the contour contrib package installed and I think the dll also is included in Umbraco Cloud projects. It explains why it has worked, but maybe an issue due some changes in Umbraco, Courier or when using it inside Archetype.

rasmusjp commented 7 years ago

No problem, I hope it fixes your issue.

I'm currently looking into upgrading the picker to match the styling of the MNTP in v7.6, I believe that unpublished/trashed items have another styling (greyed out I think), it should be ready when v7.6 is released.

I'm not sure if it'll break if you have the file in App_Code and it's also included in the Contrib dll. Maybe someone from HQ can answer that.

bjarnef commented 7 years ago

Yes, in v7.6.0 the content pickers looks like this for unpublished and nodes in recycle bin (which are unpublished too).

image

Okay, at the moment I have only the Umbraco.Courier.Contrib.Resolvers.dll, but noticed the content id's not is resolved, when deployed.. will check if it also is an issue when using Multi-Url Picker directly as property.

bjarnef commented 7 years ago

I have tested with a property, which are using multi-url picker and not nested inside archetype and can confirm Umbraco.Courier.Contrib.Resolvers.dll doesn't resolve the node id's when e.g. deploying content from local to live enviroment: https://github.com/umbraco/Umbraco.Courier.Contrib/issues/29