Hi all,

Today i did a upgrade to 6.x-2.11 for several sites. Some Views are now broken. I get the error message: "Fatal error: __clone method called on non-object in /includes/common.inc on line 1736". I think it's related with the date, because some Views are just working fine. This Views has no date in their filter or arguments.
I think i can rebuild this Views, but that will cost me a lot of time.

Anybody knows a good solution?

Comments

dawehner’s picture

Version: 6.x-2.10 » 6.x-2.11
Status: Active » Postponed (maintainer needs more info)

It would be cool if you could export one of the views which are not working anymore.

MatthijsG’s picture

Version: 6.x-2.11 » 6.x-2.10
Status: Postponed (maintainer needs more info) » Active
dawehner’s picture

Status: Active » Postponed (maintainer needs more info)

It's like comparing apples with pears. It makes no sense as long you don't have mapping between them.

This function can be called by a lot of! functions. So it is important to be able to reproduce it.
Does [834222] fix it for you?

If it's related to date module views i suggest you to move the issue to the date issue queue.

MatthijsG’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Closed. Bug is coming from a CCK field, which gives the error in the View. Stil not clear which CCKfield :-(

Starminder’s picture

Version: 6.x-2.10 » 6.x-3.x-dev
Status: Closed (fixed) » Active

I was getting this on 6x-2.11, so I upgraded to 3xdev. Unfortunately that didn't fix it. Here's an export of the view that I'm trying to build. Would love to get past this....

$view = new view;
$view->name = 'recent_images';
$view->description = '';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 3.0-alpha1;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Recent Images */
$handler = $view->new_display('default', 'Recent Images', 'default');
$handler->display->display_options['distinct'] = TRUE;
$handler->display->display_options['access']['type'] = 'none';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'mini';
$handler->display->display_options['pager']['options']['items_per_page'] = 100;
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* Empty text: Global: Text area */
$handler->display->display_options['empty']['text']['id'] = 'area';
$handler->display->display_options['empty']['text']['table'] = 'views';
$handler->display->display_options['empty']['text']['field'] = 'area';
$handler->display->display_options['empty']['text']['label'] = '';
$handler->display->display_options['empty']['text']['empty'] = FALSE;
$handler->display->display_options['empty']['text']['content'] = 'EMPTY';
/* Field: Content: Image (field_image) */
$handler->display->display_options['fields']['field_image_fid']['id'] = 'field_image_fid';
$handler->display->display_options['fields']['field_image_fid']['table'] = 'node_data_field_image';
$handler->display->display_options['fields']['field_image_fid']['field'] = 'field_image_fid';
$handler->display->display_options['fields']['field_image_fid']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_image_fid']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_image_fid']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_image_fid']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_image_fid']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_image_fid']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_image_fid']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_image_fid']['hide_empty'] = 1;
$handler->display->display_options['fields']['field_image_fid']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_image_fid']['link_to_node'] = 1;
$handler->display->display_options['fields']['field_image_fid']['label_type'] = 'none';
$handler->display->display_options['fields']['field_image_fid']['format'] = 'gallery_assist_thumb_150_default';
/* Field: Image attach: Attached images */
$handler->display->display_options['fields']['image_attach_images']['id'] = 'image_attach_images';
$handler->display->display_options['fields']['image_attach_images']['table'] = 'node';
$handler->display->display_options['fields']['image_attach_images']['field'] = 'image_attach_images';
$handler->display->display_options['fields']['image_attach_images']['label'] = '';
$handler->display->display_options['fields']['image_attach_images']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['image_attach_images']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['image_attach_images']['alter']['trim'] = 0;
$handler->display->display_options['fields']['image_attach_images']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['image_attach_images']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['image_attach_images']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['image_attach_images']['alter']['html'] = 0;
$handler->display->display_options['fields']['image_attach_images']['hide_empty'] = 1;
$handler->display->display_options['fields']['image_attach_images']['empty_zero'] = 0;
$handler->display->display_options['fields']['image_attach_images']['link_to_node'] = 1;
$handler->display->display_options['fields']['image_attach_images']['image_derivative'] = 'tumb_150';
$handler->display->display_options['fields']['image_attach_images']['as_link'] = 'node';
/* Field: Image: Image */
$handler->display->display_options['fields']['image_image']['id'] = 'image_image';
$handler->display->display_options['fields']['image_image']['table'] = 'node';
$handler->display->display_options['fields']['image_image']['field'] = 'image_image';
$handler->display->display_options['fields']['image_image']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['image_image']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['image_image']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['image_image']['alter']['trim'] = 0;
$handler->display->display_options['fields']['image_image']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['image_image']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['image_image']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['image_image']['alter']['html'] = 0;
$handler->display->display_options['fields']['image_image']['hide_empty'] = 0;
$handler->display->display_options['fields']['image_image']['empty_zero'] = 0;
$handler->display->display_options['fields']['image_image']['link_to_node'] = 0;
$handler->display->display_options['fields']['image_image']['image_derivative'] = '_original';
/* Sort criterion: Node: Post date */
$handler->display->display_options['sorts']['created']['id'] = 'created';
$handler->display->display_options['sorts']['created']['table'] = 'node';
$handler->display->display_options['sorts']['created']['field'] = 'created';
$handler->display->display_options['sorts']['created']['order'] = 'DESC';
/* Filter: Node: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = '1';
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
dawehner’s picture

Status: Active » Postponed (maintainer needs more info)

Do you have a recent version of cck installed?

Additional when you have such an error please enable the devel module on your site and write something like this into the drupal_clone function in includes/common.inc previous to the php error line.


function drupal_clone($object) {
  dsm(views_trace());
  return version_compare(phpversion(), '5.0') < 0 ? $object : clone($object);
}

Based on this you can find out what called the drupal_clone function and based on this you might be able to find the root of the problem.

esmerel’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

no activity for 30 days

kenorb’s picture

Status: Closed (cannot reproduce) » Active

I've the same problem.
After I upgraded views to 6.x-3.0-alpha3 or 6.x-3.0-dev, I've following error:

Fatal error: __clone method called on non-object in includes/common.inc on line 1733

I've CCK 6.x-3.0-alpha3, I had as well previous stable version (no difference).
So I think it's the same problem.

I see this error from CLI, because I can't see any error on the page (some MAMP bug):

$ ./drupal.sh http://drupal6/price_list
Fatal error: __clone method called on non-object in /Users/kenorb/Sites/drupal6/includes/common.inc on line 1733

This view DOES work with 6.x-2.12!

My exported view: http://pastebin.com/vxjQnx8H

Steps to reproduce:
1. Create 'company' content type and add few nodes.
2. Create 'product' content type and add few nodes.
3. Create 'Prices' vocabulary in taxonomy and add few nodes.
4. Tag some of the nodes with terms.
5. Import view from: http://pastebin.com/vxjQnx8H
6. Go to view page: /price_list
You should see the error (I think).

Query is as follow:

SELECT node_term_node.title AS node_term_node_title, node_term_node.nid AS node_term_node_nid, term_data_term_relation.name AS term_data_term_relation_name, term_data_term_relation.vid AS term_data_term_relation_vid, term_data_term_relation.tid AS term_data_term_relation_tid, node_term_node_1.title AS node_term_node_1_title, node_term_node_1.nid AS node_term_node_1_nid FROM term_data term_data  LEFT JOIN term_node term_node ON term_data.tid = term_node.tid INNER JOIN node node_term_node ON term_node.vid = node_term_node.vid LEFT JOIN term_node node_term_node__term_node ON node_term_node.vid = node_term_node__term_node.vid LEFT JOIN term_node node_term_node_node_term_node__term_node ON node_term_node.vid = node_term_node_node_term_node__term_node.vid LEFT JOIN term_relation node_term_node__term_relation ON node_term_node__term_node.tid = node_term_node__term_relation.tid1 INNER JOIN term_data term_data_term_relation ON node_term_node__term_relation.tid2 = term_data_term_relation.tid LEFT JOIN term_node term_data_term_relation__term_node ON term_data_term_relation.tid = term_data_term_relation__term_node.tid INNER JOIN node node_term_node_1 ON term_data_term_relation__term_node.vid = node_term_node_1.vid WHERE (term_data.vid in ('1')) AND (node_term_node.type in ('company')) AND (node_term_node_1.type in ('product'))

This is Taxonomy View and there are 3 relationships:
1. 'company': Taxonomy: Node (all nodes tagged by terms).
2. 'company2product': Taxonomy: Related terms (Relationship to 'company' - all terms related to 'company' content)
3. 'product': Taxonomy: Node (Relationship to 'company2product')
Basically the purpose of the terms are kind of gateway, which connecting two kind of nodes (something like node-reference, but without

There is another thing.
Testing page load of the same page: /price_list based on xdebug logs between 6.x-2.12 and 6.x-3.x - the difference of size xdebug log is very huge:

-rw-r--r--   1 kenorb  wheel   50M 12 Jul 01:04 drupal6_price_list--1310429084.xt (6.x-2.12)
-rw-r--r--   1 kenorb  wheel  471M 12 Jul 01:06 drupal6_price_list--1310429146.xt (6.x-3.x)

Looks like 3.x has some kind of loop.

I had that problem on Mac (MAMP) with PHP 5.2.17, I'll try to reproduce it on different environment (Linux).

kenorb’s picture

I've tested again, but on Linux this time.
I could reproduce this issue again, but I had to change the view a little:
Import from here: http://pastebin.com/cq6Xbx1y
Views:  6.x-3.0-alpha3 (BUT works on 6.x-3.0-dev)
CCK: 6.x-2.9

Backtrace:

( ! ) Fatal error: __clone method called on non-object in /home/kenorb/Sites/drupal/trunk/includes/common.inc on line 1733
Call Stack
# Time Memory Function Location
1 0.0009 336528 {main}( ) ../index.php:0
2 0.2289 10357352 menu_execute_active_handler( $path = ??? ) ../index.php:17
3 0.2297 10362472 call_user_func_array ( 'views_page', array (0 => 'price_list', 1 => 'page_1') ) ../menu.inc:349
4 0.2297 10362788 views_page( 'price_list', 'page_1' ) ../menu.inc:0
5 0.2444 11643500 view->execute_display( $display_id = 'page_1', $args = array () ) ../views.module:302
6 0.2974 15130412 views_plugin_display_page->execute( ) ../view.inc:846
7 0.2974 15130456 view->build( $display_id = ??? ) ../views_plugin_display_page.inc:174
8 0.3012 15399124 view->_build( $key = 'relationship' ) ../view.inc:574
9 0.3017 15405728 views_handler_relationship_node_term_data->query( FALSE ) ../view.inc:667
10 0.3017 15406636 views_plugin_query_default->add_table( $table = 'term_node', $relationship = 'node_term_node', $join = ???, $alias = ??? ) ../views_handler_relationship_node_term_data.inc:46
11 0.3018 15406724 views_plugin_query_default->adjust_join( $join = NULL, $relationship = 'node_term_node' ) ../views_plugin_query_default.inc:262
12 0.3018 15406724 drupal_clone( $object = NULL ) ../views_plugin_query_default.inc:543
Variables in local scope (#12)
$object =
null

 

kenorb’s picture

Status: Active » Fixed


Looks like it was fixed somehow in dev.
It doesn't happen with latest dev.

My mistake, it doesn't work with latest dev (it was 2.12).

kenorb’s picture

 

Here is backtrace from latest dev:

 

( ! ) Fatal error: __clone method called on non-object in /home/kenorb/Sites/drupal/trunk/includes/common.inc on line 1733
Call Stack
# Time Memory Function Location
1 0.0009 335976 {main}( ) ../index.php:0
2 0.1677 10488496 menu_execute_active_handler( $path = ??? ) ../index.php:17
3 0.1684 10493604 call_user_func_array ( 'views_page', array (0 => 'price_list', 1 => 'page_1') ) ../menu.inc:349
4 0.1684 10493920 views_page( 'price_list', 'page_1' ) ../menu.inc:0
5 0.1840 11834076 view->execute_display( $display_id = 'page_1', $args = array () ) ../views.module:439
6 0.2548 16244092 views_plugin_display_page->execute( ) ../view.inc:960
7 0.2549 16244136 view->build( $display_id = ??? ) ../views_plugin_display_page.inc:207
8 0.2592 16546088 view->_build( $key = 'relationship' ) ../view.inc:672
9 0.2598 16552740 views_handler_relationship_node_term_data->query( FALSE ) ../view.inc:772
10 0.2598 16553648 views_plugin_query_default->add_table( $table = 'term_node', $relationship = 'node_term_node', $join = ???, $alias = ??? ) ../views_handler_relationship_node_term_data.inc:45
11 0.2599 16553736 views_plugin_query_default->adjust_join( $join = NULL, $relationship = 'node_term_node' ) ../views_plugin_query_default.inc:303
12 0.2599 16553736 drupal_clone( $object = NULL ) ../views_plugin_query_default.inc:584
Variables in local scope (#12)
$object =
null

 

kenorb’s picture

Status: Fixed » Active
StatusFileSize
new1.85 KB

Attached feature including broken Views, Content types: company and product, and Taxonomy vocabulary.
After enabling go to: /price_list (to see the error).

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new717 bytes

In fact this variable isn't used.

I'm not sure whether this is the right way to fix it.

kenorb’s picture

Status: Needs review » Reviewed & tested by the community

Works great for me, removes the fatal error.

dawehner’s picture

Version: 6.x-3.x-dev » 6.x-2.x-dev
Status: Reviewed & tested by the community » Needs work

Okay the patch against 6.x-3.x worked, commited.
Sadly it didn't worked for 6.x-2.x

@kenorb
Does this all this applies to drupal7?

kenorb’s picture

I didn't test on Drupal 7

geerlingguy’s picture

Might be a problem on D7 as well; I'm testing Views Tree and some relationships, and I'm hitting this issue. I'll test and see. (Nevermind, seems to possibly be unrelated... possibly. See #1493234: Getting PHP Fatal error: __clone method called on non-object in views_handler_field_field.inc).

Dean Reilly’s picture

Version: 6.x-2.x-dev » 6.x-3.x-dev

adjust_join shouldn't be being called when there's no join defined. This has been fixed in this issue #887768: Notice: Undefined index: in views_query->add_table().

The removal of the add_table line will break a relationship between a node and its terms (unless you're lucky and the term_node is already in the query for some other reason). See issue #1409640: Taxonomy terms on node relationship potentially joins on wrong table where the problem has been reported and I've posted a patch reverting dawehner's change above.

mustanggb’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)
kenorb’s picture

Status: Closed (won't fix) » Closed (outdated)