Revision deletion does not work currently because the Bean entity type do not implement the EntityAPIRevisionableInterface interface. The deletion method provided by Bean is incorrectly named and some other code is wrong too. Also, the 'delete' link is offered for the default revision which should not be the case either (deleting default revision should be forbidden). Here is a patch that fixes the bugs and forbids deletion on controller level. The menu item for deleting the active revision is still accessible though. The access check should actually happen on menu level. I was too lazy to do that :P
Comment | File | Size | Author |
---|---|---|---|
revision-delete.patch | 3.45 KB | fubhy | |
Comments
Comment #1
indytechcook CreditAttribution: indytechcook commentedThanks fubhy, while I review this, can you please add some tests?
Comment #2
indytechcook CreditAttribution: indytechcook commentedSo this follow the class hierarchy
BeanEntityAPIController extends EntityAPIControllerExportable
EntityAPIControllerExportable extends EntityAPIController
EntityAPIController implements EntityAPIControllerRevisionableInterface
therefor BeanEntityAPIController implements EntityAPIControllerRevisionableInterface
I know php relfection is a bit dumb when it comes to finding the implementing interface in inheritance but the method deleteRevision() is on EntityAPIController so that part of the patch isn't needed.
This is probably the key piece.
Comment #3
indytechcook CreditAttribution: indytechcook commentedSo i pushed up some of this but it still needs tests.
We might want to look into adding revision level stuff to bean_access.
http://drupal.org/commitlog/commit/22232/9342623c4932e1b35b41137bbd716aa...