You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an automated process (e.g. harvest) creates a new revision of a dataset, it will always use the author of the latest revision for the next node revision.
$entity = $this->getEntityLatestRevision($uuid); // Uses the last revision as the base, including the revision_uid
...
return $this->updateExistingEntity($entity, $data); // Calls update function
...
// From updateExistingEntity()
if ($entity instanceof RevisionLogInterface) {
// Only sets new values for the revision time and log message; revision user remains what it was
$entity->setRevisionLogMessage("Updated on " . (new \DateTimeImmutable())->format(\DateTimeImmutable::ATOM));
$entity->setRevisionCreationTime(time());
}
This issue with the revision author defaulting to the last one only applies to data nodes that are updated by an automated process. It is not an issue with user-edited nodes like book pages.
The text was updated successfully, but these errors were encountered:
dafeder
changed the title
Update DKAN to use actual revision user when updating an existing entity
Use actual revision user when updating an existing entity
Dec 17, 2024
When an automated process (e.g. harvest) creates a new revision of a dataset, it will always use the author of the latest revision for the next node revision.
https://github.com/GetDKAN/dkan/blob/2.x/modules/metastore/src/Storage/Data.php#L311
https://github.com/GetDKAN/dkan/blob/2.x/modules/metastore/src/Storage/Data.php#L342
$entity = $this->getEntityLatestRevision($uuid); // Uses the last revision as the base, including the revision_uid
...
return $this->updateExistingEntity($entity, $data); // Calls update function
...
// From updateExistingEntity()
if ($entity instanceof RevisionLogInterface) {
// Only sets new values for the revision time and log message; revision user remains what it was
$entity->setRevisionLogMessage("Updated on " . (new \DateTimeImmutable())->format(\DateTimeImmutable::ATOM));
$entity->setRevisionCreationTime(time());
}
This issue with the revision author defaulting to the last one only applies to data nodes that are updated by an automated process. It is not an issue with user-edited nodes like book pages.
The text was updated successfully, but these errors were encountered: