Skip to content

Commit faa8a15

Browse files
committed
publisher: skip property version bumps for non-populated entries
This extension tracks certain property entries as an indication that a property is supported for this instance (e.g. on Confluence Cloud, a content width property exists, but not on Confluence Server (at this time?)). However, even if we track support, it does not mean that Confluence has reported the property has been defined for a page. When we publish property updates for a page, we perform a version bump to indicate to Confluence the property is being updated. Although, for non-defined property entries, the value is set to `None` with no version entries. This causes the implementation to fail since there is no version value to bump. This commit corrects this by checking that the previous value does exist before attempting any version bump; otherwise, it treats the property update event as if it was created a new property entry. Signed-off-by: James Knight <[email protected]> (cherry picked from commit ba09692)
1 parent e3acb28 commit faa8a15

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sphinxcontrib/confluencebuilder/publisher.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,13 @@ def _update_page(self, page, page_name, data, parent_id=None):
15551555
}
15561556

15571557
orig_entry = orig_meta_props.get(prop_key, None)
1558-
if orig_entry:
1558+
1559+
# if an original entry exists, make sure we bump the version
1560+
# number for this property; note that the value may be set to
1561+
# `None`, where this extension requested information about
1562+
# a property, but Confluence does not have one defined for
1563+
# a page (i.e. so we treat it as new; no version bump)
1564+
if orig_entry and orig_entry.get('value') is not None:
15591565
if orig_entry['value'] == entry['value']:
15601566
continue
15611567

0 commit comments

Comments
 (0)