cancel
Showing results for 
Search instead for 
Did you mean: 

Fatal error: Uncaught Error: Call to a member function isSuggestionsAllowed() on null

Fatal error: Uncaught Error: Call to a member function isSuggestionsAllowed() on null

I make update from Magento 2.2.3 to 2.3.6 with Porto theme. In the home page i have this error:

......./vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\View\Element\Template), '/chroot/home/ae...', Array) #4 /ch in /chroot/home/aec8be3d/b4115eb564.nxcli.io/vendor/magento/module-search/view/frontend/templates/form.mini.phtml on line 27

 

i look here: https://magento.stackexchange.com/questions/328563/fatal-error-uncaught-error-call-to-a-member-func...

but i don' have a solution

my php version is 7.1.3

3 REPLIES 3

Re: Fatal error: Uncaught Error: Call to a member function isSuggestionsAllowed() on null

Hello @papaeredi

Please run the following commands

chmod 777 var/ generated/ pub/static/ pub/media/
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush
chmod 777 var/ generated/ pub/static/ pub/media/

If your Problem Solved with this ? Click on 'Kudos' & Accept as Solution !

Re: Fatal error: Uncaught Error: Call to a member function isSuggestionsAllowed() on null

The error message you're encountering, "Fatal error: Uncaught Error: Call to a member function isSuggestionsAllowed() on null," is a PHP error, and it typically occurs when you're trying to call a method on an object that doesn't exist or is null.

Here are some steps you can take to troubleshoot and potentially resolve this error:

  1. Check for Variable Assignment: Ensure that the variable you're trying to call the isSuggestionsAllowed() method on is properly assigned and initialized. It should refer to an object that has this method.

  2. Verify Object Existence: Double-check whether the object you're trying to call the method on exists and is not null. If the object is expected to be created or returned from a function, make sure that function is working correctly and returning a valid object.

  3. Check Function Arguments: If this error occurs within a function or method, review the function's arguments to ensure you're passing the correct object as an argument, and it's not null.

  4. Error Handling: Implement error handling and checks in your code to handle cases where objects might be null or not properly initialized. You can use conditional statements (e.g., if or isset) to ensure that you're only calling methods on valid objects.

  5. Review Stack Trace: The error message usually includes a stack trace that shows the sequence of function calls leading to the error. Review this stack trace to identify the source of the issue, which can help you pinpoint where the object became null.

Without seeing your specific code and context, it's challenging to provide a precise solution, but these general steps should help you diagnose and resolve the "Call to a member function on null" error. If you're still having trouble after attempting these steps, please provide more context or code snippets for more targeted assistance. qr code scanner

Re: Fatal error: Uncaught Error: Call to a member function isSuggestionsAllowed() on null

This error indicates there is an issue with the Porto theme conflicting with the Magento 2.3.6 upgrade. A few things to try:

1. Make sure the Porto theme is fully compatible with Magento 2.3.6. Check with the theme developer for compatibility or any needed updates.

2. Try switching to a default Magento theme like Luma to see if the issue persists. This can help narrow down if the theme is the root cause.

3. Disable any custom modules/extensions and enable them one by one to find any incompatible code.

4. Check that PHP settings like memory_limit are sufficient for Magento 2.3.6 requirements.

5. Review exception.log for any additional errors that could pinpoint the conflict.

6. Try manually upgrading the Porto theme code rather than overwriting it completely during the Magento upgrade.

7. Contact the Porto theme support for assistance troubleshooting the compatibility issue.

8. As a last resort, may need to replace Porto theme with a compatible 2.3.6 alternative if updates do not resolve.

With some troubleshooting and checking for updated theme compatibility, you should be able to resolve the conflict and have the theme working properly in 2.3.6.