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

Remaining Keys Ordering Issue #293

Closed
stavultras opened this issue Aug 17, 2020 · 0 comments · Fixed by #292
Closed

Remaining Keys Ordering Issue #293

stavultras opened this issue Aug 17, 2020 · 0 comments · Fixed by #292
Milestone

Comments

@stavultras
Copy link

stavultras commented Aug 17, 2020

I found a small issue (for me it was a big issue) with $remaining_keys ordering when Internal Cache is used.
It causes random returns for keys vs $results array:
Sometimes

$remaining_keys = array_diff( $keys, array_keys( $cache ) );

can have the first index as 1, but $results array always starts from 0. It causes keys vs results descrepancies here:

foreach ( $remaining_keys as $i => $key ) {
	$value = isset( $results[ $i ] ) ? $results[ $i ] : false;

Eventually

$this->_set_internal( $key, $group, $value );

has the wrong data, because the first $value is $results[1] instead of $results[0], the second $value is $results[2] instead of $results[1] and so on.

The original issue: https://wordpress.org/support/topic/does-not-work-in-wordpress-5-5-thumbnails-2
The CR: #292

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

Successfully merging a pull request may close this issue.

2 participants