Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
In getRevisionUserId/setRevisionUserId, $this->revision_user
is used to determine the current revision user. However, there is no "revision_user" for Media entities, which means that calling these methods does nothing and throws a PHP Notice as "revision_user" is undefined.
Proposed resolution
Update getRevisionUserId/setRevisionUserId to reference revision_uid, not revision_user.
Remaining tasks
Review the patch.
User interface changes
None.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
media-entity-revision-id-api-broken.patch | 599 bytes | samuel.mortenson | |
Comments
Comment #2
phenaproximaLightning was encountering this problem while trying to include (and enable) the revision_log_default module. Our tests were failing because of it. After applying this patch, everything worked beautifully. The methods are completely broken without it, which could in a worst-case scenario result in data loss. I think this is RTBC, and I'm going to commit it.
Comment #3
phenaproximaCommitted and pushed 807c558 to 8.x-1.x. Thanks!