Issue w/ {counter} in title template on user spaces
Closed this issue · 2 comments
There is an issue when attempting to use {counter} in the title template when copying pages in user spaces.
I ran the following scenarios on a page with only text in it:
- Regular space w/ out {counter} in template title - no error.
- Regular space w/ {counter} in template title - no error.
- Personal space w/ out {counter} in template title - no error.
- Personal space w/ {counter} in template title - error:
$ python2 copier.py --src-id=27183904 --dst-title-template="{title} {counter}" --endpoint="..." --username="..." --password="..."
DEBUG:confl-copier:Searching page by id '27183904'
DEBUG:confl-copier:Setting destination space key to source's value '~andy_boutin'
Traceback (most recent call last):
File "copier.py", line 422, in
recursion_limit=args.recursion_limit
File "copier.py", line 70, in copy
dst_space_key, dst_title_template = self._init_destination_page(source, dst_space_key, dst_title_template)
File "copier.py", line 183, in _init_destination_page
counter = self._get_title_counter(space_key=dst_space_key, title=source['title'], template=title_template)
File "copier.py", line 196, in _get_title_counter
space=space_key, title=title
File "/usr/local/lib/python2.7/site-packages/PythonConfluenceAPI/api.py", line 322, in search_content
return self._service_get_request("rest/api/content/search", params=params, callback=callback)
File "/usr/local/lib/python2.7/site-packages/PythonConfluenceAPI/api.py", line 131, in _service_get_request
return self._service_request("GET", _args, *_kwargs)
File "/usr/local/lib/python2.7/site-packages/PythonConfluenceAPI/api.py", line 116, in _service_request
response.raise_for_status()
File "/usr/local/lib/python2.7/site-packages/requests/models.py", line 844, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://confluence.compellent.com/rest/api/content/search?start=0&cql=space+%3D+~andy_boutin+and+title+~+%22Dummy%22
Hi andrew,
thank you for your bug report.
I was able to reproduce your problem and fix it. Could you please give it a try?
Tried & tested today - looks great, thank you!