Hello,
I have a project that depends on countries in their entries. So, I used Rainlab’s Locations plugin; it worked fine in terms of showing the countries in a dropdown, selecting them, and even showing them in the data table. However, when filtering by country, an error gets thrown as shown:
"Call to a member function methodExists() on null" on line 237 of /Users/salahassi/dev/sada/october/modules/backend/filterwidgets/Group.php
The error is here at line 237 ($model is null):
And here is how I define it in the Tailor Blueprint:
country:
label: Country
type: dropdown
options: RainLab\Location\Behaviors\LocationModel::getCountryOptions
select: name
placeholder: Select an option
I tried to create a custom scope with no luck.
I appreciate any solution or workaround that might help.
Thanks
daft
February 11, 2024, 2:03am
#2
Hi @salahassi
It looks like we may need to add a content field for the location plugin. I noted this has been logged on GitHub so it can be followed for updates:
opened 10:49PM - 06 Feb 24 UTC
Please refer to this topic on October Talk.
https://talk.octobercms.com/t/using… -rainlabs-location-plugin-throws-an-error-on-filters/2224
Hello,
I have a project that depends on countries in their entries. So, I used Rainlab’s Locations plugin; it worked fine in terms of showing the countries in a dropdown, selecting them, and even showing them in the data table. However, when filtering by country, an error gets thrown as shown:
`"Call to a member function methodExists() on null" on line 237 of /Users/salahassi/dev/sada/october/modules/backend/filterwidgets/Group.php`
The error is here at line 237 ($model is null):

And here is how I define it in the Tailor Blueprint:
```
country:
label: Country
type: dropdown
options: RainLab\Location\Behaviors\LocationModel::getCountryOptions
select: name
placeholder: Select an option
```
I tried to create a custom scope with no luck.
I appreciate any solution or workaround that might help.
Thanks
Hi draft,
Thanks for your reply. Is there any way I could work it around so I can use it?
Appreciated!
daft
February 12, 2024, 3:07am
#5
It looks like there is a bug with this. We will fix it in v3.6. For now, disable the scope with
scope: false
After updating, the definition would look like this
country:
label: Country
type: dropdown
options: RainLab\Location\Models\Country::getNameList
select: name
placeholder: Select an option
1 Like