We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28033
    • 925 Posts
    I noticed when I was duplicating content that if I duplicated a document w/out children, it would clear the alias field (so a document w/ the same doesn’t exist). But when you duplicate a document with children, the children’s alias’s aren’t cleared.

    Shouldn’t the clearing take place for parent + children in this case?
      My Snippets
      -> PopUpChunk v1.0
      • 33337
      • 3,975 Posts
      Are you using alias paths?
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        I’ve noticed this myself; when duplicating the children, only the ’parent’ field is changed:
        	$_toplevel++;
        	$rs = $modx->db->select('id', $tblsc, 'parent='.$docid.' AND deleted=0', 'id ASC');
        	if (mysql_num_rows($rs)) {
        		while ($row = mysql_fetch_assoc($rs))
        			duplicateDocument($row['id'], $newparent, $_toplevel);
        	}
        

        Of course, if you’re using alias paths and duplicate aliases, this would be a "feature". I’ve never worried about it since usually the duplicated documents need to be edited anyway.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 28033
          • 925 Posts
          Yeah, I’m using aliases, and I have no duplicate aliases enabled.

          It’s not a big thing, since I change them anyway, it’s really more of a "shouldn’t it technically do this due to how it’s done otherwise).

          Think this would warrant a report in Jira as a minor bug?
            My Snippets
            -> PopUpChunk v1.0