Skip to content

Commit cdd2f72

Browse files
erralstevepiercydavisagli
authored
serialize layout for Plone Site in Plone 6 (#1940)
* serialize for Plone Site in Plone 6 * Update news/1939.bugfix --------- Co-authored-by: Steve Piercy <web@stevepiercy.com> Co-authored-by: David Glick <david@glicksoftware.com>
1 parent 82d0c53 commit cdd2f72

11 files changed

+20
-0
lines changed

news/1939.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Serialize the `layout` of a Plone Site if it is a Plone 6 site. @erral

src/plone/restapi/serializer/site.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ def __call__(self, version=None, include_items=True, include_expansion=True):
6565

6666
if HAS_PLONE_6:
6767
result["UID"] = self.context.UID()
68+
result["layout"] = self.context.getLayout()
69+
6870
# Insert review_state
6971
wf = getToolByName(self.context, "portal_workflow")
7072
result["review_state"] = wf.getInfoFor(

src/plone/restapi/tests/http-examples/jwt_logged_in.resp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Content-Type: application/json
5757
"title": "English",
5858
"token": "en"
5959
},
60+
"layout": "document_view",
6061
"lock": {
6162
"locked": false,
6263
"stealable": true

src/plone/restapi/tests/http-examples/navroot_site_get.resp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Content-Type: application/json
2222
"title": "English",
2323
"token": "en"
2424
},
25+
"layout": "language-switcher",
2526
"lock": {
2627
"locked": false,
2728
"stealable": true

src/plone/restapi/tests/http-examples/navroot_standard_site_content_get.resp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Content-Type: application/json
2222
"title": "English",
2323
"token": "en"
2424
},
25+
"layout": "document_view",
2526
"lock": {
2627
"locked": false,
2728
"stealable": true

src/plone/restapi/tests/http-examples/navroot_standard_site_content_get_expansion.resp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Content-Type: application/json
3939
"title": "English",
4040
"token": "en"
4141
},
42+
"layout": "document_view",
4243
"lock": {
4344
"locked": false,
4445
"stealable": true

src/plone/restapi/tests/http-examples/navroot_standard_site_get.resp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Content-Type: application/json
2222
"title": "English",
2323
"token": "en"
2424
},
25+
"layout": "document_view",
2526
"lock": {
2627
"locked": false,
2728
"stealable": true

src/plone/restapi/tests/http-examples/navroot_standard_site_get_expansion.resp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Content-Type: application/json
3939
"title": "English",
4040
"token": "en"
4141
},
42+
"layout": "document_view",
4243
"lock": {
4344
"locked": false,
4445
"stealable": true
@@ -92,6 +93,7 @@ Content-Type: application/json
9293
"title": "English",
9394
"token": "en"
9495
},
96+
"layout": "document_view",
9597
"lock": {
9698
"locked": false,
9799
"stealable": true

src/plone/restapi/tests/http-examples/site_get_expand_navroot.resp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Content-Type: application/json
3939
"title": "English",
4040
"token": "en"
4141
},
42+
"layout": "language-switcher",
4243
"lock": {
4344
"locked": false,
4445
"stealable": true
@@ -116,6 +117,7 @@ Content-Type: application/json
116117
"title": "English",
117118
"token": "en"
118119
},
120+
"layout": "language-switcher",
119121
"lock": {
120122
"locked": false,
121123
"stealable": true

src/plone/restapi/tests/http-examples/siteroot.resp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Content-Type: application/json
5757
"title": "English",
5858
"token": "en"
5959
},
60+
"layout": "document_view",
6061
"lock": {
6162
"locked": false,
6263
"stealable": true

0 commit comments

Comments
 (0)