Skip to content

[Confluence] confluence.remove_page() method may not remove all child pages.  #936

Description

@hograthm

Sometimes methond confluence.remove_page() with parameter recursive=True can't delete all child pages.
Instead it will delete only fixed number of child pages and delete a root page. All remaining child pages will be moved to the root of the space.
This is possible because inside confluence.remove_page() we use confluence.get_page_child_by_type()

def get_page_child_by_type(self, page_id, type="page", start=None, limit=None, expand=None):
"""
Provide content by type (page, blog, comment)
:param page_id: A string containing the id of the type content container.
:param type:
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
:param limit: OPTIONAL: how many items should be returned after the start index. Default: Site limit 200.
:param expand: OPTIONAL: expand e.g. history
:return:
"""

By default limit=None, but In my case it was 25 by default. This led to an incorrect amount of executions here:
if recursive:
children_pages = self.get_page_child_by_type(page_id)
for children_page in children_pages:
self.remove_page(children_page.get("id"), status, recursive)

At the moment, I still have not trace what forces limit to take default value 25. Maybe this is a bug.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions