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

Copying a blocks page to a subsite does not copy blocks #393

Closed
brynwhyman opened this issue Sep 30, 2018 · 4 comments
Closed

Copying a blocks page to a subsite does not copy blocks #393

brynwhyman opened this issue Sep 30, 2018 · 4 comments

Comments

@brynwhyman
Copy link

Using dnadesign/silverstripe-elemental 4.x-dev 4aee187

If a blocks page includes draft/saved/published blocks, when copying to the page to a subsite through 'Subsite Operations' function, the expected result is the page and the containing blocks are copied to the subsite. Current behaviour copies the page but does not include the saved/published blocks.

Comment from @robbieaverill

We probably need to implement recursive duplication. I think subsites has some of its own logic for duplicating across subsites, I refactored some of it recently. It should be using the recursive duplication logic from core as much as possible though. It's also possible that this is fixed with an unreleased version of subsites, need to check.

Also I think this would be a subsites fix (when we treat elements as arbitrary examples of related models), so we could move this to subsites if you want to @brynwhyman ?

@sminnee
Copy link
Member

sminnee commented Oct 25, 2018

Underlying issue is that duplicateToSubsite() doesn't respect cascade_duplicates, it instead has its own setting duplicate_to_subsite_relations

Two possible solutions:

  • Add duplicate_to_subsite_relations config in the elemental module
  • Update duplicateToSubsite() to respect cascade_duplicates.

https://github.com/silverstripe/silverstripe-subsites/blob/master/src/Extensions/SiteTreeSubsites.php#L242

@NightJar
Copy link
Contributor

Option 2 is the better approach :)

@robbieaverill
Copy link
Contributor

Worth noting that we've deprecated duplciateSubsiteRelations in favour of the cascade duplicates API already.

I actually can't reproduce this issue using SilverStripe 4.4.x-dev, Subsites 2.3.x-dev and Elemental 4.1.x-dev

@robbieaverill
Copy link
Contributor

Yeah, confirmed this is working in the above modules

@robbieaverill robbieaverill removed their assignment May 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants