strapi-plugin-location
strapi-plugin-location copied to clipboard
Error: Undefined attribute level operator 0
Issue Description
When making a request to the Strapi plugin with the $location[coords]
parameter, I've observed an issue where if I set the radius to a value greater than 406, it results in an error: Error: Undefined attribute level operator 0
. Upon further investigation, it seems that this error is related to a change in the data type of the variable when the array of IDs contains a large number of elements.
Steps to Reproduce
- Make a request with the following parameters:
?$location[coords]=40.848557,14.255131,406
. - Observe the error:
Error: Undefined attribute level operator 0
.
Expected Behavior
The plugin should handle requests with a radius greater than 406 without producing an error.
Additional Information
I noticed that when the array of IDs becomes large, the data type of the variable appears to change from an array of numbers to an array of objects. This transition in data types may be the root cause of the issue.
Environment
- Node.js version: 18.16.1
- Strapi version: 4.9.1
- Plugin version: 1.1.4
- Operating system: Ubuntu
Please let me know if you need any more information or if there are specific steps to reproduce the issue.