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

Fatal error addFielToFilter() #2

Closed
Axel29 opened this issue Jan 29, 2018 · 4 comments
Closed

Fatal error addFielToFilter() #2

Axel29 opened this issue Jan 29, 2018 · 4 comments

Comments

@Axel29
Copy link

Axel29 commented Jan 29, 2018

Hi,

If php-geoip is not installed, there's a fallback to the database tables but the code breaks in this case.

Here's the error:

Fatal error: Uncaught Error: Call to undefined method Magefan\GeoIp\Model\ResourceModel\IpToCountry\Collection::addFielToFilter() in /var/www/vendor/magefan/module-geoip/Model/IpToCountryRepository.php:56 Stack trace: #0 /var/www/vendor/magefan/module-geoip/Model/IpToCountryRepository.php(74): Magefan\GeoIp\Model\IpToCountryRepository->getCountryCode('127.0.0.1') #1 /var/www/app/code/Clrz/GeoIp/Helper/Popin.php(193): Magefan\GeoIp\Model\IpToCountryRepository->getVisitorCountryCode() #2 /var/www/app/code/Clrz/GeoIp/view/frontend/templates/switch/languages.phtml(35): Clrz\GeoIp\Helper\Popin->getUserCountry() #3 /var/www/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/var/www/projec...') #4 /var/www/vendor/magento/framework/View/Element/Template.php(270): Magento\Framework\View\TemplateEngine\Php->render(Object(Clrz\GeoIP\Block\Store\Switcher\Interceptor), '/var/www/projec...', Array) #5 /var/www/generated/code/Clrz/GeoIP/Block/Store/Switcher/Interce in /var/www/vendor/magefan/module-geoip/Model/IpToCountryRepository.php on line 56

@Axel29
Copy link
Author

Axel29 commented Jan 29, 2018

EDIT : Found the issue (took me some time to really READ the error ^^")

You used "addFielToFilter", there's a "d" missing for "addFieldToFilter" for both lines 56 and 57.

@magefan
Copy link
Owner

magefan commented Jan 29, 2018

Thank you. Making correction.

@magefan
Copy link
Owner

magefan commented Jan 29, 2018

The fix was made. Please try to update the extension to the version 2.0.1

@Axel29
Copy link
Author

Axel29 commented Jan 29, 2018

That was fast :) Thanks, it works perfectly even without php-geoip now!

@Axel29 Axel29 closed this as completed Jan 29, 2018
magefan added a commit that referenced this issue Feb 17, 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

No branches or pull requests

2 participants