When new users try to register, they get:
Fatal error: __clone method called on non-object in /path_to_drupal/includes/common.inc on line 1497
This apparently started happening after we upgraded to php 5.2.9. The MySQL is 5.0.77.
Updating Drupal from 5.1 to 5.16 didn't fix it. The Web server is Apache, the Unix is Redhat, all up to date.
You can see the error happening if you try to register at http://www.kuphitau.com/
Comments
Comment #1
jmcneely commenteddrat, this issue still exists after the upgrade to Drupal 5.18. The only difference is that the error message is:
Fatal error: __clone method called on non-object in /
/includes/common.inc on line 1506
Comment #2
celston commentedIn core, there are only calls to drupal_clone in modules/node/node.module and modules/taxonomy/taxonomy.module. Most calls in node.module are wrapped in an is_object check. The only others deal with node_preview and theme_node_preview which I doubt new users are hitting. That only leaves taxonomy.module, specifically taxonomy_get_tree, line 1012.
Should there be a check that $terms[$vid][$child] is defined and an object?
Comment #3
damien tournoud commentedCould you give us more information about this error? For example, try to add the following debug code at the beginning of drupal_clone():
And report the results.
Comment #4
jmcneely commentedWe did come up with a workaround that allowed new users to register again. It is weird because the problem appears to be in a version check for PHP4, and we are using PHP5.
In /includes/common.inc:
# line1506
When we comment out this 'function' the gallery2 module fails to load.
Fatal error: Call to undefined function drupal_clone() in /path_to_drupal/sites/all/modules/gallery/gallery.module on line 70
--
But when we just commented out the single line of the phpversion check, it worked :)
So the 'function' is still there, and commenting out the version check for php4 doesn't seem to break anything.
P.S.: Except that it did break the taxonomy module's ability to display the lists of terms in vocabularies. It doesn't display any error message, it just displays a blank list of terms, with no Names, for all the vocabularies. The entries for each term are still present, but the Names are blank. Even the entries for the Forums vocabulary are blank, and, alas, the Forums disappeared. When I uncommented that line, the Forums came back, but new-user registration is more important than the forums ...
Comment #5
jmcneely commentedThank you very much for the reply!
That debug code reports back:
Array ( [0] => Array ( [file] => /path_to_drupal/includes/bootstrap.inc [line] => 961 [function] => require_once ) [1] => Array ( [file] => /path_to_drupal/includes/bootstrap.inc [line] => 902 [function] => _drupal_bootstrap [args] => Array ( [0] => 7 ) ) [2] => Array ( [file] => /path_to_drupal/index.php [line] => 13 [function] => drupal_bootstrap [args] => Array ( [0] => 7 ) ) )
Comment #6
asimmonds commentedThat backtrace looks like the debug code from #3 was placed outside a function, instead of something like:
Comment #7
dpearcefl commentedConsidering the lack of activity on this issue and that Drupal v5 is no longer supported by fixes or patches, I am going to close this ticket. If this issue still exists and you want to continue to ask for technical support, please reopen and update this ticket.