While executing search index command in pimcore 10.5 version on production gives below error
method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given
Pimcore version: 10.5.15 Php version: 8.1 Mysql version: 8.0 Composer version 2.7.2
Please let me know the how to solve this issue.
Thanks
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hey there!
That error usually means Pimcore is trying to call method_exists()
on a null
value, it’s likely coming from a class or object that isn’t being set properly.
You should check if any of your custom data objects or classes might be returning null
. Add a check like:
if ($obj && method_exists($obj, 'someMethod')) {
// Safe to call the method
}
Also run this to rebuild your class definitions just in case something’s out of sync:
bin/console pimcore:deployment:classes-rebuild
And clear your cache too:
bin/console cache:clear
If you’re getting a stack trace or line number, that can help narrow it down; feel free to share it.
- Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.