You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like this is an unintended interaction of batching and the fact that in POST responses the content now gets serialized back to the client (#144):
On a POST, the serializer for the content object that just got created will be looked up and called. For folderish objects, the serializer will delegate building of items, items_total and the @id to a HypermediaBatch.
The HypermediaBatch's logic for constructing its canonical_url is admittedly pretty naive: It basically just takes it from request['ACTUAL_URL'], which worked just fine for GET, where the request hits the container in question. But for POST, the target object is the container where the new folder will be created, hence the incorrect canonical_url.
This raises a couple questions:
Does it make sense to setresult['@id'] to batch.canonical_url in the folder serializer? (I might just have copied that over without thinking too much about it)
Do we even want to delegate this stuff to HypermediaBatch when serializing in a POST? Newly created containers will be empty by definition, at least until we've got some sort of bulk-creation API
I created a folder on a fresh Plone 4.3.7 installation.
REQUEST:
RESPONSE:
PROBLEM:
@id
ishttp://localhost:8080/Plone
, but I expectedhttp://localhost:8080/Plone/a-folder
.Be aware that it works correctly with
Document
, but it does not withFolder
.The text was updated successfully, but these errors were encountered: