Git Product home page Git Product logo

adi.trash's People

Contributors

auroremariscal avatar idgserpro avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

adi.trash's Issues

Plone-5 compat

  • Change browser-view-permission from "zope2.DeleteObjects" to "zope2.View"
    While it makes sense for the first phase to ask if delete-perms are given, that does not work when CSFR-protection gets in the way and makes the user stop at the view (which is otherwise not exposed directly to the user).

  • Add auth-token to view, see: plone/plone.app.viewletmanager@c38b556

New release

Hello !

is it possible to make a new release of this package ?

Thank you and regards,

Laurent.

This package breaks if you're using plone.protect

When using a Plone 4.3.x installation with https://github.com/plone/plone.protect and trying to delete an object and the root of the site with a url like folder_contents?_authenticator=2c4b1c9a84b7d48b7ef39080239c62db34406382, you get

2017-07-26 16:07:54 ERROR Zope.SiteErrorLog 1501096074.850.287455953144 http://localhost:18928/Plone/@@adi_trash_view
Traceback (innermost last):
  Module ZPublisher.Publish, line 138, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 48, in call_object
  Module adi.trash.browser.browser, line 63, in __call__
  Module plone.api.content, line 2, in move
  Module plone.api.validation, line 70, in wrapped
  Module plone.api.content, line 2, in move
  Module plone.api.validation, line 131, in wrapped
  Module plone.api.content, line 190, in move
  Module OFS.CopySupport, line 206, in manage_pasteObjects
  Module plone.dexterity.content, line 214, in _verifyObjectPaste
  Module Products.CMFCore.PortalFolder, line 421, in _verifyObjectPaste
ValueError: Disallowed subobject type: Plone Site

This happens because of this line:

if landing_url.endswith('/folder_contents'):

if landing_url.endswith('/folder_contents'):

The if is always False and you wrongly enter in # We're coming from a folder_contents' delete-button: condition, when actually you're not there.

Something more robust should be used instead, like

from urlparse import urlparse
# We're coming from a folder_contents' delete-button:
if urlparse(landing_url).path.endswith('/folder_contents'):

This is a nice time to start adding tests infrastructure to this package.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.