Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Commit

Permalink
Special case when we change the id of the path, it would be needed to…
Browse files Browse the repository at this point in the history
… also invalidate its soons it needs more work
  • Loading branch information
Ramon Navarro Bosch committed Jan 3, 2017
1 parent 3955d84 commit c168e87
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/plone.server/plone/server/api/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,15 @@ async def __call__(self):
behaviors = data.get('@behaviors', None)
for behavior in behaviors or ():
self.context.add_behavior(behavior)

if '__name__' in data:
# Special case we need to change the id of the content we
# also need to delete the caches of the paths
if hasattr(self.context, '_v_physical_path'):
del self.context._v_physical_path
if hasattr(self.context, '_v_get_content_path'):
del self.context._v_get_content_path

deserializer = queryMultiAdapter((self.context, self.request),
IResourceDeserializeFromJson)
if deserializer is None:
Expand Down
2 changes: 1 addition & 1 deletion src/plone.server/plone/server/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def get_physical_path(context):
parts.append(parent.__name__)
parent = parent.__parent__
parts.append('')
context._v_physical_path = reversed(parts)
context._v_physical_path = [x for x in reversed(parts)]
return context._v_physical_path


Expand Down

0 comments on commit c168e87

Please sign in to comment.