Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Selection a position for a new page doesn't work if there are versions of any page at the same level of the tree #751

Closed
Artur0802 opened this issue Jul 30, 2020 · 0 comments
Assignees
Labels

Comments

@Artur0802
Copy link

Scenario:

  1. Login to C1 CMS Console.

  2. Install Orckestra.Versioning.VersionPublication addon if it's not installed.

  3. Create a version of any child page in the tree.

    3.a. Select any child page in the tree and click "Edit page":

image

 3.b. Click "Add version" at the opened form:

image

 3.c. Enter the name of the new version and click "OK":

image

  1. Return to the "Content" tab and start adding a new page at the same level of the tree:

image

  1. Enter the title and choose the "Select position" option in the "Position field":

image

  1. Click "Next" and the error will occur:

image

The full text of the error is attached - Error.txt

Looks like there is a related to the Orckestra.Versioning.VersionPublication​ addon bug in this class (https://github.com/Orckestra/C1-CMS-Foundation/blob/dev/Composite.Workflows/Plugins/Elements/ElementProviders/PageElementProvider/AddNewPageWorkflow.cs) .
If we choose "Select position" option we get into this block of code:

if (this.GetBinding<string>("SelectedSortOrder") == SortOrder.Relative)
            {
                Dictionary<Guid, string> existingPages = PageServices.GetChildren(GetParentId()).ToDictionary(page => page.Id, page => page.Title);

                this.Bindings["ExistingPages"] = existingPages;
                this.Bindings["RelativeSelectedPageId"] = existingPages.First().Key;
            }

The problem is PageServices.GetChildren(GetParentId()) method returns all versions of a page. As all versions of the same page have the same PageId we get the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants