An Illegal Choice when Natural sort is exposed as an exposed filter.

Created on 24 September 2019, over 5 years ago
Updated 12 June 2024, 7 months ago

When trying to use natural sort in a sort criteria that is exposed and results are paged with AJAX enabled, loading subsequent pages fails with a PHP error Illegal choice NASC in Order element.. The values NASC and NDESC are failing validation in the exposed form validator.

Steps to reproduce:

  1. Minimal site install $ drush si minimal
  2. Enable modules views, views_ui, views_natural_sort $ drush en views, views_ui, views_natural_sort
  3. Create a content type
  4. Create enough content of that type to be able to page results (I used devel_generate, but theoretically 2 should be enough)
  5. Create a block view of an unformatted list of the content type
  6. Add Sort Criteria of the Content's Title. Check radio to Sort ascending naturally and Expose the sort...
  7. Use pager: Mini and set the page size to smaller than the total number pieces of content you created
  8. Enable Use AJAX: Yes
  9. Save the view
  10. Flush the cache $ drush cr
  11. In preview, try to load the second page of results
  12. The page should not load, and there should be an Error in recent logs
πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States percoction

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States hershy.k

    @generalredneck - I applied the patch on our site and am seeing the update db fail with the following output. See attached.

    Tech specs:
    Drupal: v10.1.3
    VNS: v2.0.0-alpha7
    PHP: v8.1

  • Status changed to Needs review 7 months ago
  • πŸ‡·πŸ‡΄Romania cslevy

    I couldn't apply the patch from #8 so I recreated the patch to work with the latest version of the module

Production build 0.71.5 2024