Hello,

I've created the following block with Views, but it doesn't work, when it's enabled on a page, I can't load the page... Is the list view incompatible with teaser field ?

Here's the errror

Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/includes/menu.inc on line 953

And here's the view


$view = new stdClass();
  $view->name = 'bloghead';
  $view->description = 'Headline blog';
  $view->access = array (
);
  $view->view_args_php = '';
  $view->block = TRUE;
  $view->block_title = 'A la Une';
  $view->block_header = '';
  $view->block_header_format = '1';
  $view->block_footer = '';
  $view->block_footer_format = '1';
  $view->block_empty = '';
  $view->block_empty_format = '1';
  $view->block_type = 'list';
  $view->nodes_per_block = '1';
  $view->block_more = FALSE;
  $view->block_use_page_header = FALSE;
  $view->block_use_page_footer = FALSE;
  $view->block_use_page_empty = FALSE;
  $view->sort = array (
    array (
      'tablename' => 'node',
      'field' => 'created',
      'sortorder' => 'DESC',
      'options' => 'normal',
    ),
  );
  $view->argument = array (
  );
  $view->field = array (
    array (
      'tablename' => 'node',
      'field' => 'title',
      'label' => '',
      'handler' => 'views_handler_field_nodelink',
      'options' => 'link',
    ),
    array (
      'tablename' => 'node',
      'field' => 'created',
      'label' => '',
      'handler' => 'views_handler_field_date',
    ),
    array (
      'tablename' => 'node_data_field_imgae_du_billet',
      'field' => 'field_imgae_du_billet_fid',
      'label' => '',
      'handler' => 'content_views_field_handler_group',
      'options' => 'normal',
    ),
    array (
      'tablename' => 'users',
      'field' => 'name',
      'label' => '',
    ),
    array (
      'tablename' => 'node',
      'field' => 'body',
      'label' => '',
      'handler' => 'views_handler_field_teaser',
    ),
  );
  $view->filter = array (
    array (
      'tablename' => 'node',
      'field' => 'type',
      'operator' => 'OR',
      'options' => '',
      'value' => array (
  0 => 'blog',
),
    ),
  );
  $view->exposed_filter = array (
    array (
      'tablename' => 'node',
      'field' => 'type',
      'label' => '',
      'optional' => '0',
      'is_default' => '0',
      'operator' => '0',
      'single' => '0',
    ),
  );
  $view->requires = array(node, node_data_field_imgae_du_billet, users);
  $views[$view->name] = $view;


Thank You

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

By "teaser field" I mean Node-> body with "teaser" option but teaser or full results to the same error...

merlinofchaos’s picture

Status: Active » Postponed (maintainer needs more info)

Hmm. No, it shouldn't be incompatible. It suggests that maybe you've got something going on that is creating a loop when attempting to call node_view to get the node's teaser. There's no easy way for me to tell what's going on from here.

elv’s picture

I think I had the same issue. You filter by type (blog) like I did. For some reason, when I tried to access the standard /blog page I was thrown in an infinite loop.
I read about a negative PID in menu.inc somewhere else, and it seemed related to my issue.
I also saw there was a disabled "blogs" menu added to the navigation menu when Blog module is enabled.
So I enabled it and boom. No more infinite loop... If I disable it again, I guess then it has a negative PID and the infinite loop is back.

By the way, at the moment in Views, when I go to Export, Tools, or Theme Wizard page, the title of the page is "My blog". I can't understand why !
I tried to reproduce it on a fresh install but it works as expected. So I guess I messed up somewhere, but I'm still puzzled. I don't know what went wrong.

elv’s picture

OK, I could reproduce it on a fresh install :

- enable blog module
- enable views (I also had Views UI and Wizard enabled)
- create a view with a filter showing blog entries, then enable the block and set it to list view, and display the node:body

Now try to go to yourDrupalRoot/blog, and you should get the infinite loop.

The only way arounf I found was to go to the menus admin, and enable the "blogs" menu item which is disabled by default.

I still don't know if it's an issue with menus, blog, or views...

brenda003’s picture

Title: List View incompatible with teaser field ? » Strange behavior w/ blog views, pages titled "My blog"
Version: 5.x-1.5 » 5.x-1.6
Status: Postponed (maintainer needs more info) » Active

I'm getting just what elv describes.. but despite following his instructions various pages, such as "search" pages, have the title "My blog".

What I did was, create a view with the path "blog", filter by node: type blog. Going to that page resulted in a timeout. I fixed that problem, but the "My blog" title still stays on my search pages.

brenda003’s picture

More info... deleted the offending view and the titles are back to normal. Import the view back in (from two different staging environments) and it happens again. Here is my exported view. Also note that this is NOT a page view, but only a block view.

  $view = new stdClass();
  $view->name = 'blogs';
  $view->description = '';
  $view->access = array (
);
  $view->view_args_php = '';
  $view->page = FALSE;
  $view->page_title = 'Recent Blogs';
  $view->page_header = '';
  $view->page_header_format = '1';
  $view->page_footer = '';
  $view->page_footer_format = '1';
  $view->page_empty = '';
  $view->page_empty_format = '1';
  $view->page_type = 'teaser';
  $view->url = '';
  $view->use_pager = TRUE;
  $view->nodes_per_page = '10';
  $view->block = TRUE;
  $view->block_title = 'Blogs';
  $view->block_header = '';
  $view->block_header_format = '1';
  $view->block_footer = '';
  $view->block_footer_format = '1';
  $view->block_empty = '';
  $view->block_empty_format = '1';
  $view->block_type = 'list';
  $view->nodes_per_block = '5';
  $view->block_more = TRUE;
  $view->block_use_page_header = FALSE;
  $view->block_use_page_footer = FALSE;
  $view->block_use_page_empty = FALSE;
  $view->sort = array (
    array (
      'tablename' => 'node',
      'field' => 'created',
      'sortorder' => 'DESC',
      'options' => 'normal',
    ),
  );
  $view->argument = array (
  );
  $view->field = array (
    array (
      'tablename' => 'node',
      'field' => 'title',
      'label' => '',
      'handler' => 'views_handler_field_nodelink',
      'options' => 'link',
    ),
    array (
      'tablename' => 'node',
      'field' => 'body',
      'label' => '',
      'handler' => 'views_handler_field_teaser',
    ),
    array (
      'tablename' => 'node',
      'field' => 'link',
      'label' => '',
      'options' => 'more',
    ),
  );
  $view->filter = array (
    array (
      'tablename' => 'node',
      'field' => 'status',
      'operator' => '=',
      'options' => '',
      'value' => '1',
    ),
    array (
      'tablename' => 'node',
      'field' => 'type',
      'operator' => 'OR',
      'options' => '',
      'value' => array (
  0 => 'blog',
),
    ),
  );
  $view->exposed_filter = array (
  );
  $view->requires = array(node);
  $views[$view->name] = $view;

Ah ha!! If I change the view's name from "blogs", it works. If I change it back, it's broken again. Looks like the title of the view is the culprit and these are two different issues altogether.

brenda003’s picture

Hmm, seems I was wrong.. the "My blog" title reappeared. So odd, this is.

John Hwang’s picture

FileSize
42.21 KB

I'm getting the same issue. I fixed it by reassigning the parent of "Blogs" to the menu I was displaying on that page. I'm assuming this has something to do with defining a menu item for blog rather than using the original blogs menu item.

However, the breadcrumb and the page title are still displaying "Home > Blogs > My Blog". This is when I navigate to the Themes Settings page or the "Register New Account" tab, ...etc.

The funny thing is, this was happening with Forums yesterday. I did an upgrade to views from 4.0 to 4.1 and now the blogs breadcrumb/title are displaying everywhere where the title/breadcrumb are not explicitly defined.

I've attached a screenshot of the themes page.

John Hwang’s picture

I know don't know if this is a view issue, but I have the exact same symptoms. I'm assuming one of my views is causing the problem.

merlinofchaos’s picture

I hate to suggest this as a solution, but do you even need 'blog' module? Can you turn off blog module, create the views that you need, and use a content type you created? I suspect that what's happening is that when Views generates the teaser, blog.module is actually calling drupal_set_title because it thinks the situation is different than it is.

merlinofchaos’s picture

This may be caused by: http://drupal.org/node/198593

brenda003’s picture

Status: Active » Needs review
FileSize
783 bytes

You're right, it seems to fix it.

Here's a two line patch, for the heck of it.

yched’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
1.23 KB

Attached patch also fixes the undefined $page variable a few lines below.
Marked http://drupal.org/node/198593 as duplicate.
This should be RTBC.

catch’s picture

dodorama’s picture

I think the problem still exists.
Did the patch ever get committed?

Grantovich’s picture

Looks like Views just hasn't had a stable 5.x release since this issue was found. I just ran into it myself, and luckily it happened to break in a way that eventually led me here. Is a new point release planned for sometime soon?

merlinofchaos’s picture

Planned yes, soon no. =)

Views 2 is a higher priority for me right now, sorry.

esmerel’s picture

Status: Reviewed & tested by the community » Closed (won't fix)

At this time, only security fixes will be made to the 5.x version of Views.