Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#13 | views_node.inc_.patch | 1.23 KB | yched |
#12 | falsetrue.patch | 783 bytes | brenda003 |
#8 | Picture 1.png | 42.21 KB | John Hwang |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedBy "teaser field" I mean Node-> body with "teaser" option but teaser or full results to the same error...
Comment #2
merlinofchaos CreditAttribution: merlinofchaos commentedHmm. 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.
Comment #3
elv CreditAttribution: elv commentedI 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.
Comment #4
elv CreditAttribution: elv commentedOK, 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...
Comment #5
brenda003I'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.
Comment #6
brenda003More 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.
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.
Comment #7
brenda003Hmm, seems I was wrong.. the "My blog" title reappeared. So odd, this is.
Comment #8
John Hwang CreditAttribution: John Hwang commentedI'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.
Comment #9
John Hwang CreditAttribution: John Hwang commentedI 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.
Comment #10
merlinofchaos CreditAttribution: merlinofchaos commentedI 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.
Comment #11
merlinofchaos CreditAttribution: merlinofchaos commentedThis may be caused by: http://drupal.org/node/198593
Comment #12
brenda003You're right, it seems to fix it.
Here's a two line patch, for the heck of it.
Comment #13
yched CreditAttribution: yched commentedAttached patch also fixes the undefined $page variable a few lines below.
Marked http://drupal.org/node/198593 as duplicate.
This should be RTBC.
Comment #14
catchhttp://drupal.org/node/164169 was duplicate.
Comment #15
dodorama CreditAttribution: dodorama commentedI think the problem still exists.
Did the patch ever get committed?
Comment #16
Grantovich CreditAttribution: Grantovich commentedLooks 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?
Comment #17
merlinofchaos CreditAttribution: merlinofchaos commentedPlanned yes, soon no. =)
Views 2 is a higher priority for me right now, sorry.
Comment #18
esmerel CreditAttribution: esmerel commentedAt this time, only security fixes will be made to the 5.x version of Views.