Open Vaelor opened 5 years ago
@Vaelor thank you for supporting this issue.
Could you describe in which case this error appears? If I'm reading the code of the get_term_link
method correct, then it returns an WP_Error
if the $term
is not an object. The message indicates that the term is empty. Is this the case if you have assigned a post entry to a term and after that you are deleting this term in the term list view?
@florianrusch
$term
has a value (at least $term->slug
printed 'balcony'). There is a plug-in for wpcasa 'extendable fields' or something like that - sorry for the vagueness - which allows to add tag like properties.
But, currently the main reason that this happened at all seems to be a small database corruption, which happened from upgrading WP 5.1 to 5.2. I am not yet completely sure. I will try to update you with further information, but maybe this is a rare occurrence and normally wouldn't happen.
Not sure if the check for wperror should still be made or if it's better to throw since this should never happen?
So, thanks for your time on this. The reason this happened at all, was a plugin called wp-optimize - which it seems was run on the database - and corrupted a part of it. I believe the error I described here probably never happens under normal circumstances - at least if no database corruption occurs.
I would leave it up to you, to close this issue, since I do not know if catching that error is something one would/should do or if throwing it is better. Sorry for bothering you :-)
No problem. @JoeHana is currently working on a new version of WPCasa. I don't know if he'll consider that.
Hi! First of all - not much PHP experience, nor WordPress. Itried to fix a page, where the plugin threw an error:
Catchable fatal error: Object of class WP_Error could not be converted to string in https://github.com/wpsight/wpcasa/blob/master/wpcasa/includes/class-wpsight-helpers.php#L680
There is a function call to
get_term_link
which throws. I am googled a bit, found it is a WordPress function and it has a note attachedhttps://developer.wordpress.org/reference/functions/get_term_link/#more-information
Did that.
Not sure if I 'fixed' it or what potential side effects there could be, the page seems to be (mostly) working again.
Setup: WordPress 5.2.1 PHP 7.2.18 MySQL 5.5.60 WPCasa 1.0.6.1 If you need any more Input, please let me know. I have no clue what could be important for you.