plone / Products.CMFPlone

The core of the Plone content management system
https://plone.org
GNU General Public License v2.0
255 stars 191 forks source link

@@plone_lock_operations called for wrong URL #2061

Closed pgrunewald closed 1 year ago

pgrunewald commented 7 years ago

BUG/PROBLEM REPORT

What I did:

  1. Create or edit a Document (or any other type).
  2. Wait 5 minutes till the AJAX request @@plone_lock_operations/refreshlock occurs.

What I expect to happen:

The result of the AJAX request refreshes the lock.

What actually happened:

The result of the AJAX request is the view of the Document.

What version of Plone/ Addons I am using:

Plone version 4.3.14.

--

The main problem is, that url from the base-tag is being used which now points to the actual url instead of the context's url. I guess it can be easily fixed by applying the proposal from #2051 and rewriting this line.

hvelarde commented 7 years ago

@rodfersou this is also related with #1710.

ale-rt commented 7 years ago

I also had annoyances with plone locking redirecting top the view of the object recently, so I added an optional parameter redirect=True (to keep the previous behavior unchanged):

If the redirect is "falsish" the view method will return None. I do not like a view to return None but this is also coherent with the implementation I found in the force_unlock method.

I left the default behavior as it was. Can you check if calling @@plone_lock_operations/refreshlock?redirect:int=0 will fix the issue? Of course you need the latest plone.locking checkout.

rodfersou commented 7 years ago

I did some pull requests to fix this and other issues related:

https://github.com/plone/Products.CMFPlone/pull/2101/files https://github.com/zopefoundation/Products.CMFDefault/pull/1/files https://github.com/plone/plonetheme.sunburst/pull/17/files https://github.com/plone/plonetheme.sunburst/pull/17/files https://github.com/plone/plonetheme.classic/pull/6/files

rodfersou commented 7 years ago

Jenkins job: http://jenkins.plone.org/job/pull-request-4.3/22/console

jensens commented 1 year ago

fixed long time ago