We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When creating the list of categories and assigning posts to it before pagination, wrong category is chosen because of sort.
Code can be found in categories.rs in parse_categories_list Snippet:
parse_categories_list
let mut cur_cat = if let Ok(idx) = parent.sub_cats.binary_search_by(|c| { compare_category_path( c.cat_path.iter().map(|v| v.as_view()), cat_full_path.iter().copied(), ) }) { &mut parent.sub_cats[idx] } else { let last_idx = parent.sub_cats.len(); parent .sub_cats .push(Category::with_path(cat_full_path.into_iter())); // need to sort for binary_search_by parent.sub_cats.sort_by(|c1, c2| { compare_category_path( c1.cat_path.iter().map(|v| v.as_view()), c2.cat_path.iter().map(|v| v.as_view()), ) }); &mut parent.sub_cats[last_idx] };
Here if order is changed because of sorting then last_idx will return the wrong category.
last_idx
The text was updated successfully, but these errors were encountered:
Not good. Thanks for reporting this!
Sorry, something went wrong.
Has this been resolved?
No branches or pull requests
When creating the list of categories and assigning posts to it before pagination, wrong category is chosen because of sort.
Code can be found in categories.rs in
parse_categories_list
Snippet:
Here if order is changed because of sorting then
last_idx
will return the wrong category.The text was updated successfully, but these errors were encountered: