Adoxio / xRM-Portals-Community-Edition

The definitive edition of Microsoft Open Source Portals, supported by the experts in portals.
MIT License
107 stars 60 forks source link

CMS Content Editor - When saving content changes French page we get Web page with same partial url already exists. #95

Closed fainelia closed 5 years ago

fainelia commented 5 years ago

We have multilingual web site, English and French, when working with French pages we get the following error and are not able to save the content changes. image

fainelia commented 5 years ago

From our investigation we found that there is a conflicting code between CmsEntityChildrenHandler and Entity.JS. CmsEntityChildrenHandler pulls children pages that belong to the same parent of the edited page, and when doing so it uses OranizationServiceContextExtensions where current language child pages are filtered out, While Entity.JS validates the partial url uniqueness by checking if the page with the same GUID exists in the list provided by CmsEntityChildrenHandler and since the French page was filtered out it, it is not found and we get the error described above.

fainelia commented 5 years ago

Our suggested solution would be to add extra parameter of RootWebPageId to ExtendedSiteMapChildInfo Populating it image

and using it in the validation in Entity.JS

image

Please disregard debuggers

Unless it is safe to remove the filter on the child pages with the current language

fainelia commented 5 years ago

or this option for Entity.JS. that is more similar to current logic of current.length

image

amervitz commented 5 years ago

@fainelia I'm unable to reproduce this issue. How were the web pages involved created? Do the localized content web page records already exist for the two languages?

fainelia commented 5 years ago

@amervitz , I just tested again, after upgrading CRM to v9.1 the issue is not there anymore, I think we can close this issue, anyway the fix I suggested above was breaking something else.