When saving a bean, a revision is stored with the original author uid that created the bean. I was expecting the active user uid to be saved as the author of the revision.

I've tracked down an issue in the Entity module where there's a little bit of code mentioned, but it was never added in any of the patches: https://drupal.org/node/996696#comment-4779752

I'm not sure if this should go into Entity or just be the responsibility of the entities themselves.

Comments

spadxiii’s picture

Status: Active » Needs review
StatusFileSize
new660 bytes

Created a small patch for the BeanEntityAPIController that stores the active user's uid in the revision.

Status: Needs review » Needs work

The last submitted patch, bean-revision_uid-2095595-1.patch, failed testing.

spadxiii’s picture

Status: Needs work » Needs review
StatusFileSize
new576 bytes

New patch fixes wrong path .. oops! :)

Status: Needs review » Needs work

The last submitted patch, bean-revision_uid-2095595-3.patch, failed testing.

spadxiii’s picture

Status: Needs work » Needs review

Looks like the automated test fails because of irrelevant reasons: "Fatal error: Class 'NodeAccessRecordsUnitTest' not found" ?

nicksanta’s picture

I've applied the patch against 7.x-1.2 and it works great.

indytechcook’s picture

Great work. I already committed but I had one question before this issue gets closed.

+++ b/includes/bean.core.inc
@@ -484,6 +484,17 @@ class BeanEntityAPIController extends EntityAPIControllerExportable {
+    $entity->uid = $org_uid;

Is there a reason why we set this back?

spadxiii’s picture

I set it back to original author because I didn't want to overwrite the uid that created the entity.

indytechcook’s picture

Status: Needs review » Fixed

Super. Thanks again.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

helmo’s picture

Issue summary: View changes

I think code from this issue caused a new problem ... see #2625786: Uid in revision lost when reverting feature