Book Pages Clone

Created on 21 August 2019, over 5 years ago
Updated 22 March 2023, about 2 years ago

Hi,
Is it possible to clone book pages with child nodes ?
Thanks

Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇭🇺Hungary balagan

    Rerolled the patch in https://www.drupal.org/project/entity_clone/issues/3076356#comment-14715404 Book Pages Clone Needs work to apply for the 2.x branch.

    Meanwhile looking at the code I think the condition at line 117 is not what really what we want.

    I have changed
    $bid = isset($entity->book) && empty($entity->book['bid']) ? 0 : $entity->book['bid'];
    to
    $bid = !isset($entity->book) || empty($entity->book['bid']) ? 0 : $entity->book['bid'];

  • 🇭🇺Hungary balagan

    I have simplified the condition a bit more.
    $bid = !empty($entity->book['bid']) ? $entity->book['bid'] : 0;

  • Status changed to Needs review about 2 years ago
  • The last submitted patch, 17: entity_clone-book_support-3076356-17.patch, failed testing. View results
    - codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

  • Status changed to Needs work 2 months ago
  • By applying patch #17, I was able to clone a book and its children pages.
    The problem I confront was with the moderation state.
    When I tried to clone the entire book and select a moderation state, the cloned cover book had the selected status but the children pages ignore my moderation status selection.
    So, I add some code to set the moderation state of cloned children pages according to the choice of the user.
    Also, the patch cannot be applied successfully using a git apply command cause there is a difference in surrounding line context which is from a previous version.
    I create a new patch based on #17 with the fixes on issues described above.

  • 🇮🇳India rajeshreeputra Pune

    Created MR with patch from #20 Book Pages Clone Needs work for easy code review and to see the tests.

  • When I tried to add a commit with fixes (drupal standards and php coding standards), I saw that the specific pull request has target the version 2.x branch which is compatible with Drupal 10 but on the other hand the fork repository includes branches that are compatible only with Drupal < 10. How can I handle this?

  • 🇮🇳India rajeshreeputra Pune

    @mariab, 2.x branch is now available in fork repository.

Production build 0.71.5 2024