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

Updating the title of an existing page does not work #133

Open
askalski85 opened this issue Oct 16, 2024 · 0 comments
Open

Updating the title of an existing page does not work #133

askalski85 opened this issue Oct 16, 2024 · 0 comments

Comments

@askalski85
Copy link

Why

In readme it is described that https://github.com/iamjackg/md2cf/blob/master/README.md#updating-an-existing-page

To update a page using its ID, use the --page-id option. This allows you to modify the page's title 

Small investigation

According to the code got the update call:
https://github.com/iamjackg/md2cf/blob/master/md2cf/api.py#L195

        update_structure = {
            "version": {
                "number": page.version.number + 1,
                "minorEdit": minor_edit,
            },
            "title": page.title,  # <-- using the passed existing_title is hardcoded
            "type": content_type,
            "body": {"storage": {"value": body, "representation": "storage"}},
        }

And the upsert operation when the page exists:
https://github.com/iamjackg/md2cf/blob/master/md2cf/upsert.py#L100

            existing_page = confluence.update_page(
                page=existing_page, # <-- We are passing existing_page with old title 
                body=page.body,
                parent_id=page.parent_id,
                update_message=page_message,
                labels=page.labels if replace_all_labels else None,
                minor_edit=minor_edit,
            )

Outcome

Page title is never updated. This was my first observation and apparently if I am not wrong this is the implemented behaviour. We should either fix the readme or the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant