Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use actual revision user when updating an existing entity #4358

Open
TheETupper opened this issue Dec 16, 2024 · 0 comments
Open

Use actual revision user when updating an existing entity #4358

TheETupper opened this issue Dec 16, 2024 · 0 comments

Comments

@TheETupper
Copy link

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.

@dafeder 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant