Changes between Initial Version and Version 1 of Ticket #35013
- Timestamp:
- 12/11/2015 02:36:26 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #35013 – Description
initial v1 2 2 3 3 Here's the problem: 4 Fatal error: __clone method called on non-object in /var/www/html/lesmenuires/wp-includes/class-wp.php on line 612 4 `Fatal error: __clone method called on non-object in /var/www/html/lesmenuires/wp-includes/class-wp.php on line 612` 5 5 6 6 So I went on having a look at what this function does, and this particular line, here's what I have: 7 $p = clone $wp_query->post; 7 `$p = clone $wp_query->post;` 8 8 9 9 I've just updated a multi site install to WordPress 4.4, and that is a core WordPress file so you should have the same code than me when looking at this file on the WP4.4 branch. … … 12 12 13 13 I've tried a little fix like so: 14 $p = is_object($wp_query->post) ? clone $wp_query->post : null; 14 `$p = is_object($wp_query->post) ? clone $wp_query->post : null;` 15 15 And that fixed my issue. But as this is a WordPress core file, I can't leave it like this that's why I'm reporting this to you today. 16 16 … … 22 22 23 23 Here's the complete stack trace with comments: 24 {{{ 24 25 Fatal error: __clone method called on non-object in /var/www/html/lesmenuires/wp-includes/class-wp.php on line 612 25 26 Call Stack … … 30 31 4 0.8151 56045448 WP->main( ) ../functions.php:947 31 32 5 0.8173 56095592 WP->handle_404( ) ../class-wp.php:677 //Fatal 32 33 }}} 33 34 Thanking you very much. 34 35 … … 36 37 37 38 PS: I have echoed a var_dump of $wp_query just before this line to give you a little more context if that's of any help: 38 39 {{{ 39 40 object(WP_Query)[165] 40 41 public 'query_vars' => … … 211 212 array 212 213 empty 214 }}}
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)