Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Publish pages in the new editor #125

Open
stevenlockton-progenity opened this issue Nov 18, 2020 · 7 comments
Open

Publish pages in the new editor #125

stevenlockton-progenity opened this issue Nov 18, 2020 · 7 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@stevenlockton-progenity
Copy link

stevenlockton-progenity commented Nov 18, 2020

I notice that conflr publishes pages in the old Confluence style/editor and there doesn't seem to be an option to select the new editor. A workaround is to immediately convert the just-conflr-published page to the new editor right away, but that breaks all the code hiding. Any subsequent updates to the same page retains the style in the new editor!

Is there any intention on catering to users of the new editor/confluence page style in the near future?

@yutannihilation
Copy link
Contributor

Oh, I didn't know about the new editor. Sorry, I don't have any plans to implement it in the near future. As you noticed the new one seem to have an incompatible format to the old one, I'm afraid this will be a very tough job...

@januz
Copy link

januz commented Jun 9, 2021

We are still running a version of Confluence with the old editor so I can't test this, but maybe just adding the metadata information to the POST call as described in this Atlassian Community thread would work?! https://community.atlassian.com/t5/Confluence-questions/Creating-space-using-REST-API-creates-it-with-quot-old-quot/qaq-p/1275954#M185773

@yutannihilation
Copy link
Contributor

Wow, thanks for the information! Hmm, I think this is a bug on Confluence's side so hope they fix this, but given that this is a year-old issue, it's unlikely to happen...

https://jira.atlassian.com/browse/CONFCLOUD-68057

@januz
Copy link

januz commented Jun 9, 2021

Yeah, I know it is a problem on their end but I thought it might be easy to implement this workaround in your package and have a user select the editor version when posting a page.

@BenoitFayolle
Copy link

Looks like Confluence recently fixed CONFCLOUD-68057 !

@yutannihilation
Copy link
Contributor

Oh, thanks for sharing!

So..., while it's a cool news, the new editor's becoming default means now I need to think seriously about how to switch between new and old editors? As conflr converts .md into the syntax of the old editor and it's probably not completely compatible, I'm afraid the API returns an error in some cases 🤔

https://jira.atlassian.com/browse/CONFCLOUD-68057?focusedCommentId=2873144&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-2873144

@dpprdan
Copy link

dpprdan commented Jan 19, 2022

Not sure whether this helps, but this is an error I am getting after the document is rendered to markdown. The image upload seems to work fine, but the document seems to be the problem.

Checking the existing images...
Uploading the images...
Uploading the document...
Backtrace:
    x
 1. \-rmarkdown::render(...)
 2.   \-output_format$post_processor(...)
 3.     +-rlang::exec(...)
 4.     \-(function (title, space_key, type, parent_id, html_text, imgs, ...
 5.       \-conflr::confl_update_page(id = id, title = title, body = html_text)
 6.         \-conflr:::confl_verb(...)
 7.           \-rlang::abort(...)
 8.             \-rlang:::signal_abort(cnd)
Error: Error in paste(httr::http_condition(res, type = "error"), httr::content(res)): Bad Request (HTTP 400).
 400
* Error in paste(httr::http_condition(res, type = "error"), httr::content(res)): Bad Request (HTTP 400).
 list(authorized = FALSE, valid = TRUE, errors = list(), successful = FALSE)
* Error in paste(httr::http_condition(res, type = "error"), httr::content(res)): Bad Request (HTTP 400).
 com.atlassian.confluence.api.service.exceptions.BadRequestException: Content body cannot be converted to new editor format
Backtrace:
    x
 1. \-rmarkdown::render(...)
 2.   \-output_format$post_processor(...)
 3.     +-rlang::exec(...)
 4.     \-(function (title, space_key, type, parent_id, html_text, imgs, ...
 5.       \-conflr::confl_update_page(id = id, title = title, body = html_text)
 6.         \-conflr:::confl_verb(...)
Execution halted

Also, I have rendered documents successfully on this instance before, but they are without images. In fact they get updated weekly via CI. All pages with new editor, AFAICT.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants