Skip to content

Provide a more secure method of obtaining the revision id from a Node when file versioning is used. #52092

@bdovaz

Description

@bdovaz

Is your feature request related to a problem? Please describe.

IMetadataVersionBackend requires a revision which is not easy to know where to get this data from.

public function setMetadataValue(Node $node, int $revision, string $key, string $value): void;

Initially I got it by calling getVersionsForFile from IVersionBackend which returns instances of Version that have this field:

public function getVersionsForFile(IUser $user, FileInfo $file): array;

But then looking at this class I see that it is much simpler than that, you can do a node->getMTime() directly and this is precisely what is not easy to know:

$this->versionManager->setMetadataValue($node, $node->getMTime(), 'author', $author);

That is why I ask if there would be a possibility of passing a Node to return the "last revisionId" of the same one and that this detail falls in a method and the user does not have to know it.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmapenhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions