Kentico/xperience-by-kentico-kentico-migration-tool

Placing items under another item in content tree results in Invalid operation exception.

Felwick opened this issue · 1 comments

Brief bug description

This relates to issue 185. Moving some items underneath other item results in Url path exception where application tries to execute Linq method over likely empty collection resulting in IOE. This suggests to problem with WebPageUrlPath.

Exception details:
Event ID: 161
Source: WebPagesApplication
Event code: MovePage
User ID: 53
User name: administrator
IP address::1
Description
Message: Sequence contains no matching element
Exception type: System.InvalidOperationException
Stack trace:
at System.Linq.ThrowHelper.ThrowNoMatchException()
at System.Linq.Enumerable.First[TSource](IEnumerable1 source, Func2 predicate)
at CMS.Websites.Routing.WebPageUrlPathLanguagePathsUpdater.Update(WebPageItemInfo webPage,
CancellationToken cancellationToken)
at CMS.Websites.Routing.WebPageUrlManager.ChangeWebPageUrlPathsAfterMove(WebPageItemInfo
webPageItem, CancellationToken cancellationToken)
at CMS.Websites.WebPageManager.Move(MoveWebPageParameters parameters, CancellationToken
cancellationToken)
at
Kentico.Xperience.Admin.Websites.UIPages.WebPagesApplication.MovePage(MoveWebPageCommandArguments args,
CancellationToken cancellationToken)
Machine name: W22001
Event URL: /admin/api/cmd
URL referrer: http://localhost:3212/admin/webpages-1/en-US_0
User agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0
Safari/537.36

Repro steps

Steps and migrations are same as in issue 158.

Expected behavior

Web pages items should be nested under each other as needed

We have a ticket from a customer that also involves this error message. I'm not going to mention the customer specifics here, but it is in my ticket queue for those curious. They are sending over a few resources that may help us, but for now here is what I was able to confirm in the ticket and on a call with them.

  • The project was migrated from X13 to XbyK 28.4.4.
  • They are using the Move pages API example to test moving their pages around in the content tree. However, the code fails, and throws the above error.
  • As a test, they used the same code on a Dancing Goat XbyK sample project with no issues.
  • They can also move pages directly in the Admin using drag-and-drop.
  • Their code does not use LINQ. As I said, the code they are using is based off our API example and is only moving one single page.

I'm wondering if this has something to do with the state of the migrated content. However, I also tested a project I migrated to v28.4.1, and the issue did not occur. A single page moved successfully.

Perhaps there are differences in how the migration can be configured; bringing content into XbyK in some format that may or may not cause the API to fail. Let me know if there is something specific we can share.