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

Fix sorting by certain attributes #83

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

jiru
Copy link

@jiru jiru commented Jul 10, 2023

This fixes sorting by attributes which data type do not use value_sortable field for sorting.

This includes attribute of type currency, file size, floor plan, geocode, integer, length, time code, weight, and also date range in older versions of Providence.

A simple way to reproduce the bug this PR solves is to try to browse objects sorted by price. Using the default installation profile, each object has a purchase_price attribute, so you can add a "sort by price" sort in browse.conf:

browseTypes = {
        objects = {
                sortBy = {
                        Price = ca_objects.purchase_price,
                },
        },
}

You will see that Pawtucket fails to sort correctly in that case. It also fails to sort similar attributes from related tables.

This fixes sorting by attributes
which data type do not use value_sortable field.

This includes attribute of type currency, file size,
floor plan, geocode, integer, length, time code, weight,
and also date range in older versions of Providence.
@collectiveaccess
Copy link
Owner

Thanks for noticing this. This is the correct solution.

@collectiveaccess collectiveaccess merged commit e79a3d6 into collectiveaccess:develop Jul 10, 2023
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 this pull request may close these issues.

2 participants