conflr icon indicating copy to clipboard operation
conflr copied to clipboard

Publish pages in the new editor

Open stevenlockton-progenity opened this issue 3 years ago • 7 comments

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?

stevenlockton-progenity avatar Nov 18 '20 23:11 stevenlockton-progenity

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...

yutannihilation avatar Nov 19 '20 11:11 yutannihilation

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

januz avatar Jun 09 '21 22:06 januz

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

yutannihilation avatar Jun 09 '21 23:06 yutannihilation

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.

januz avatar Jun 09 '21 23:06 januz

Looks like Confluence recently fixed CONFCLOUD-68057 !

BenoitFayolle avatar Sep 17 '21 10:09 BenoitFayolle

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 :thinking:

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

yutannihilation avatar Sep 17 '21 10:09 yutannihilation

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.

dpprdan avatar Jan 19 '22 13:01 dpprdan