I have a linux server and when updating posts I receive this error when in debug mode, Any help is greatly appreciated thanks.
Catchable fatal error: Object of class WP_Term could not be converted to string in /public_html/wp-includes/taxonomy.php on line 2285
You're trying to use an object as a string. I think there's a filter or action running in the save_post action.
Do you have some custom code using get_terms ?
The function has change it's parameter order since WordPress 4.5. See more details here
If you have any plugin or code using this function, try to change, update or desactivate them.
Related
I am working on Laravel 8 , I have tried to use findOrFail method in order to set redirection to 404 error not found instead of displaying error but it is showing this error method findOrFail not found,
this is the line of code in ProfilesController that is causing the error
$user = User::findOrFail($user);
this is the output of the error
enter image description here
Thanks in advance,
Look like your code works fine. The issue Php Strom not able to identify methods.
I always use query() method to get autocomplete model methods
$user=User::query()->findOrFail($user);
or you might need to install any extension which can able to identify laravel methods
I'm trying to use the dump function as was advides by a bunch of people, so I could get a better hang of Timber/TWIG.
However when I try it i get the following error:
Fatal error: Uncaught Twig_Error_Syntax: Unknown "dump" function.
I am confused, since this should be included in Timber itsself.
Another thing is that ACF (Wordpress) functions don't seem to work.
Just enable the WP debug in wp-config.
define('WP_DEBUG', true);
I have a two PHP Notices at one of my project - "Trying to get property of non-object"
I know whats that means (more or less), but the problem is i can't find which code element make this notice... this drive me crazy...
Trying to get property of non-object in /xxxxxxxxxxxx/wp-includes/class-wp-query.php on line 3871
( At github is here -> https://github.com/WordPress/WordPress/blob/master/wp-includes/class-wp-query.php#L4029 )
Trying to get property of non-object in /xxxxxxxxxxxxxx/wp-includes/link-template.php on line 643
( At github is here -> https://github.com/WordPress/WordPress/blob/master/wp-includes/link-template.php#L673 )
In this project i used:
My own template
Woocommerce plugin (latest release)
ACF (latest release)
Yoast SEO (latest release)
Maybe is something wrong with my custom query?
For example this is what i use:
' https://pastebin.com/YEBQAXgs '
The question is: how can i find/catch this notice and figure which part of my code should i correct?
It comes from Woocommerce wc_prevent_adjacent_posts_rel_link_wp_head function which is actioned by the template_redirect hook.
It does a call to is_singular('product') which gets the queried object and if the query is for a feed it comes back NULL and therefore is not an object.
With what you posted, it’s probably a Symptom of an invalid sql query. If you try to prepare bad sql, it won’t generate a statement object which will lead to that error.
I have been getting this error since I updated my woocommerce plugin:
Fatal error: Call to undefined function array_replace_recursive()
The errror is on line 586:
enter image description here
I have found some solutions in this quote here:
Fatal error: Call to undefined function array_replace_recursive() for CI Controller solution
But the problem is that i really do not know what to change in my code or where, in order fot the error to stop popping up. Any help would be greatly appreciated.
Check your PHP version. array_replace_recursive only available in PHP >= 5.3.
Reference:
array_replace_recursive
since I updated my WooCommerce plugin
I suggest you check once by deactivating all plugins except WooCommerce and by activating default WordPress theme. It may be possible that any of your plugin is not compatible with the latest WooCommerce plugin.
Let me know if that doesn't work...
I have created custom shipping module and gets following error:
Fatal error: Call to a member function setStore() on a non-object in /home/devjoand/public_html/includes/src/Mage_Shipping_Model_Shipping.php on line 421
I removed all files including .xml for this shipping module and it still gives me the same error. It doesn't send me to shipping method and stops execution from savebilling controller with above error. I have cleared cache/session and recompile but nothing works. Any help would be appreciated. Thanks in advance!
NOTE: It works fine in my local machine but not working on production server.
As described partially in the comments, the error comes from this code:
$obj = Mage::getModel($className);
if ($storeId) {
$obj->setStore($storeId);
}
In the code above $obj is set to null.
You stated that your removed a shipping carrier.
I think the problem appears because you didn't deactivate first the carrier.
So in the config table the carrier appears to be enabled but there is no model associated to it so the code above fails.
In order to fix this, look in the table core_config_data for a record with this path column: carriers/CARRIER_CODE_HERE/active, where CARRIER_CODE_HERE is the code of the shipping method you just removed.
When you find the line, remove it. Actually remove everything that has a path like carriers/CARRIER_CODE_HERE/%.
be sure to backup your database first in case I'm wrong.