Skip to content
This repository was archived by the owner on Jul 28, 2024. It is now read-only.
This repository was archived by the owner on Jul 28, 2024. It is now read-only.

Tracking original IDs or general order #1420

@pavelevap

Description

@pavelevap

During work on test infrastructure we found a problem with order of posts on cloned site. When there are several posts (or other items) published at the same time and ordered by that time, their order can be different on original and cloned site, see example in #1409 (comment).

Order on original site is based on ID (order from database storage), but cloned site depends on loading .ini files through iterators:

private function getEntityFiles()
{
if (!is_dir($this->directory)) {
return [];
}
$directoryIterator = new RecursiveDirectoryIterator($this->directory);
$recursiveIterator = new RecursiveIteratorIterator($directoryIterator);
$iniFilesIterator = new RegexIterator($recursiveIterator, '~^.+\.ini$~i', RecursiveRegexIterator::GET_MATCH);
return array_keys(iterator_to_array($iniFilesIterator));
}

And VersionPress ignores original IDs, so there is currently no way to order posts by their original ID on cloned sites.

Maybe there is a time to start tracking original IDs (VP could make a clean clone with original IDs which could be helpful in some cases) or general order (VP could generally know order of created items at least).

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionNeeds discussion or is being discussed.scope: coreCore VersionPress functionality like tracking actions, creating Git commits, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions