plone / guillotina

Python AsyncIO data API to manage billions of resources
https://guillotina.readthedocs.io/en/latest/
Other
187 stars 51 forks source link

Bug in content move() #941

Closed masipcat closed 4 years ago

masipcat commented 4 years ago

I'm implemeting a subscriber that listens to IBeforeObjectMovedEvent. I expect that the obj received in the event is the original object (before beign moved to the new destionation / id) but it's already moved.

As you can see in the following code (L804) context.id is modified to new_id and the BeforeObjectMovedEvent is fired after this change.

https://github.com/plone/guillotina/blob/f370ecd7c3396929f5d33aed70e47b72a98173b9/guillotina/content.py#L802-L830

It's ok to move this after the BeforeObjectMovedEvent @bloodbare @vangheem ? This might break existing applications relying on this behavior, though

vangheem commented 4 years ago

@masipcat Hmm, that definitely seem like a bug.

I'm okay correcting it. It doesn't affect me; however, maybe it should just go into master?

masipcat commented 4 years ago

I'm ok with doing it only in master/G6. i'll fix it!