theCrag / website

theCrag.com: Add your voice and help guide the development of the world's largest collaborative rock climbing & bouldering platform
https://www.thecrag.com/
111 stars 8 forks source link

facetted search server error on last page when sorting ascending by grade #1929

Closed scd closed 9 years ago

scd commented 9 years ago

From user (Joel)....

Hello,

I'm running into some issues when using the grade search & sorting ascending by grade - it seems to work fine except on the last page of results (even if that page is the first and only page). This is the error displayed:

Apache Module Load Portal Error: Error: Modification of non-creatable array value attempted, subscript -1 at line 419. Stack: [:419](this is returned with a http status of 400)

Sorting by other methods (ie. popularity) doesn't seem to cause the same issues, and sorting descending by grade seems ok.

These are the two areas I have tried: http://www.thecrag.com/climbing/australia/frog-buttress/routes/?sortby=grade,asc http://www.thecrag.com/climbing/australia/kangaroo-point/routes/?sortby=grade,asc

I also note that when sorting by other methods (ie. alphabetical) there are a large number of 'empty' routes results being returned at the end.

scd commented 9 years ago

regression issue with bulk edit line addition. Using a hard coded 0.99 on the data array created spurious null records. Non defensive coding the cause the server error. Hot fixed both issues.