Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cut/copy & paste of many items #201

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions news/200.bugifx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Save cut/copy clipboard to ``request.SESSION`` instead of a cookie.
[petschki]
6 changes: 3 additions & 3 deletions plone/app/content/browser/contents/copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ def finish(self):
oblist.append(m.dump())
cp = (0, oblist)
cp = _cb_encode(cp)
resp = self.request.response
resp.setCookie('__cp', cp, path='%s' % cookie_path(self.request))
self.request['__cp'] = cp
self.request.SESSION.set('__cp', cp)
# set cookie only for pat-structure actions
self.request.response.setCookie('__cp', '1', path='%s' % cookie_path(self.request)) # noqa: E501

def __call__(self):
self.oblist = []
Expand Down
6 changes: 3 additions & 3 deletions plone/app/content/browser/contents/cut.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ def finish(self):
oblist.append(m.dump())
cp = (1, oblist)
cp = _cb_encode(cp)
resp = self.request.response
resp.setCookie('__cp', cp, path='%s' % cookie_path(self.request))
self.request['__cp'] = cp
self.request.SESSION.set('__cp', cp)
# set cookie only for pat-structure to enable paste action
self.request.response.setCookie('__cp', '1', path='%s' % cookie_path(self.request)) # noqa: E501

def __call__(self):
self.oblist = []
Expand Down
3 changes: 2 additions & 1 deletion plone/app/content/browser/contents/paste.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __call__(self):
self.dest = parent.restrictedTraverse(parts[-1])

try:
self.dest.manage_pasteObjects(self.request['__cp'])
self.dest.manage_pasteObjects(self.request.SESSION.get('__cp'))
except ConflictError:
raise
except Unauthorized:
Expand All @@ -59,4 +59,5 @@ def __call__(self):
else:
raise e

self.request.SESSION.set('__cp', None)
return self.message()