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

Copy content node with descendants is not preserving sort #8033

Closed
jpinto3488 opened this issue Apr 29, 2020 · 18 comments · Fixed by #8158 or #10091
Closed

Copy content node with descendants is not preserving sort #8033

jpinto3488 opened this issue Apr 29, 2020 · 18 comments · Fixed by #8158 or #10091
Labels
community/up-for-grabs status/stale Marked as stale due to inactivity type/bug

Comments

@jpinto3488
Copy link

Umbraco 8.6.1 running on Umbraco Cloud.

Copy a node with some children, options:

  • Relate to original: false
  • Include descendants: true

The descendants of the copied element will have a different sort than the original.

@nul800sebastiaan
Copy link
Member

Ah yes, it looks like we order them by create date, would be good to get that fixed.

Note: not a Cloud problem but a CMS problem,

@umbrabot
Copy link

Hi @jpinto3488,

We're writing to let you know that we've added the Up For Grabs label to your issue. We feel that this issue is ideal to flag for a community member to work on it. Once flagged here, folk looking for issues to work on will know to look at yours. Of course, please feel free work on this yourself ;-). If there are any changes to this status, we'll be sure to let you know.

For more information about issues and states, have a look at this blog post

Thanks muchly, from your friendly PR team bot :-)

@kjac
Copy link
Contributor

kjac commented May 24, 2020

Good one! PR in #8158

@nul800sebastiaan
Copy link
Member

Fixed in #8158

@nul800sebastiaan
Copy link
Member

False alarm! This was actually not fixed in that PR unfortunately. 🙈

@vladicaivanovski
Copy link

So what is the status of this issue, when can we expect it to be fully resolved?

Currently running on version 8.9.1, it's still present and currently a big issue for our site.

@mathew65
Copy link

I was running version 8.10.1 and problem was still present. After upgrading to 8.12.1 it seems it's still not solved.

@RyanHelmn
Copy link

Happy to take a look at this, will update here of any progress ✌

@ricbrady
Copy link
Contributor

I'm running version 8.12.1 and problem still present.
Any solutions?

@nul800sebastiaan
Copy link
Member

This is still "up for grabs", happy to look at any pull requests for this.

@ricbrady
Copy link
Contributor

Hi @nul800sebastiaan
I've fixed and tested the Bug.
How can I push it and create a pull request?

@nul800sebastiaan
Copy link
Member

Awesome @ricbrady! There's some explanation in our contributing docs: https://github.com/umbraco/Umbraco-CMS/blob/v8/contrib/.github/CONTRIBUTING.md#how-do-i-begin

In short:

  • Fork the Umbraco repository
  • Clone your fork locally
  • Make a branch for the fix
  • Fix the problem
  • Push the branch to your clone
  • On GitHub you can now send us a pull request with that fix

@ricbrady
Copy link
Contributor

I've done. #10091

@OwainWilliams
Copy link
Contributor

Fixes #10091

@nul800sebastiaan
Copy link
Member

Unfortunately we had to revert the fix in PR #10091 for now.

@robgha01
Copy link

robgha01 commented Oct 28, 2021

What is the status on this ? we ran into this issue today using Umbraco 8.17.0 when our customer where testing the copy function.

They going to use it when the site goes live to replicate "schools" its around 40+ the problem is we coded it to use the last item as a special menu button and ye :D i have to see if we can code something in to solve it for now.

For those who want a quick fix until this is fixed:

[RuntimeLevel(MinLevel = RuntimeLevel.Run)]
    public class CopiedEventComposer : ComponentComposer<CopiedEventEvent>
    {
    }

    public class CopiedEventEvent : IComponent
    {
        public void Initialize()
        {
            ContentService.Copied += ContentServiceOnCopied;
        }
        
        public void Terminate()
        {
            ContentService.Copied -= ContentServiceOnCopied;
        }

        private void ContentServiceOnCopied(IContentService sender, CopyEventArgs<IContent> e)
        {
            e.Copy.SortOrder = e.Original.SortOrder;

            if (e.Copy.IsDirty())
            {
                sender.Save(e.Copy, raiseEvents: false);
            }
        }
    }

@umbrabot
Copy link

Hiya @jpinto3488,

Just wanted to let you know that we noticed that this issue got a bit stale and might not be relevant any more.

We will close this issue for now but we're happy to open it up again if you think it's still relevant (for example: it's a feature request that's not yet implemented, or it's a bug that's not yet been fixed).

To open it this issue up again, you can write @umbrabot still relevant in a new comment as the first line. It would be super helpful for us if on the next line you could let us know why you think it's still relevant.

For example:

@umbrabot still relevant
This bug can still be reproduced in version x.y.z

This will reopen the issue in the next few hours.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@umbrabot umbrabot added the status/stale Marked as stale due to inactivity label Jul 12, 2022
@enemyss
Copy link

enemyss commented Nov 10, 2022

@umbrabot still relevant 10.3.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community/up-for-grabs status/stale Marked as stale due to inactivity type/bug
Projects
None yet