Error: __clone method called on non-object in /home/umwarsza/public_html/includes/common.inc, line 1780

Comments

rolfmeijer’s picture

Same here, using drush 5.8, Drupal 6.28 and Views 2.16. And PHP 5.2.6-1+lenny16, as it seems to have somehing to do with a clone function for PHP 4. Lines 1776-1781 in common.inc are:

/**
 * Provide a substitute clone() function for PHP4.
 */
function drupal_clone($object) {
  return version_compare(phpversion(), '5.0') < 0 ? $object : clone($object);
}
rolfmeijer’s picture

Digging a little bit further I found this on line 243 from views_data_export.drush.inc:

$view->display[$new_display_id] = drupal_clone($view->display[$display_id]);

If that is done without the drupal_clone function everything seems to work fine:

$view->display[$new_display_id] = $view->display[$display_id];

I’m not sure what happens to PHP 4.0 or if there are any other caveats.

rolfmeijer’s picture

Status: Active » Needs review

OK, I think I’ve found it.

What went wrong on my part was that I didn’t include the proper display_id in the drush command. I wrote:
drush views-data-export Beschikbaarheid_Gids data_export_1 filename.csv
Where I should have written:
drush views-data-export Beschikbaarheid_Gids views_data_export_1 filename.csv
mind the “views_” prefix for the display_id.

Mołot’s picture

Same here. With proper display id it works. That makes it a bug in command's input validation. It should output a readable "wrong parameter, avaliable displays are:" for us, and do NOT try to proceed with what it got from us if we make mistake.

steven jones’s picture

Status: Needs review » Closed (won't fix)

Sorry, but the 6.x-3.x branch isn't supported, I think this was fixed in the other branches though.