Closed (fixed)
Project:
Display Suite
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Aug 2011 at 14:22 UTC
Updated:
9 Mar 2018 at 17:40 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
swentel commentedI can reproduce but haven't looked further. My guess is that there's a loop going on here, will investigate more later.
Comment #2
dazz commentedsubscribe
Comment #3
swentel commentedOk, so it's impossible to render a node inside a node like this and I can't find a way to find recursive loops here to break them off if needed (except hacking in core, which is not a good idea of course). I've added a new menu item at admin/structure/ds/emergency which allows you to break off theming through DS temporarily so you can fix any configuration errors. This is really the best that I can do right now.
Comment #5
jramby commentedHi there,
Is there any achievements on this till these days about commits on the drupal module? Is it commited somewhere on dev or other version?
Thanks, it's such a powerfull module that you've done, thanks again.
PS : I changed status to active, I don't know if in "closed(fixed)" status this message will be seen.
Comment #6
swentel commentedIt's in the dev version yes, even in an official release too.
Comment #7
jramby commentedHi again,
On these version : 7.x-1.x-dev, 7.x-2.0-rc-1
I'm still getting the same errors on the node pages that have been opened with the buggish version.
What should I do to get rid of this error ont these pages?
Thanks.
Comment #8
swentel commentedYou need to go to 'emergence' and skip the node rendering. Most likely, you're trying to render nodes inside other nodes which simply isn't possible at all.
Comment #9
jramby commentedThank you swentel. I rendered fields in the view and it's OK.
Comment #10
j0rd commentedI've run into this too.
I was re-factoring my view modes to be more modular....but after all the work, I come to find this bug.
Use case was
FULL VIEW MODE
TEASER VIEW MODE (duplicate title & avatar fields)
REFACTORED FULL MODE
Reason I want to do this is, my TEASER has about 18 fields, and is used on 4 different node types. Any change in TEASER, also requires the change in FULL if I'm simply duplicating fields. If I could bundle them up, I would only have to make the change once.
Is there another way to do this? Or am I just going to have to do it all manually.
Comment #11
hazah commentedI am interested in knowing what the actual issue is. Where is this failing in the core? Had anyone investigated that far?
Comment #12
ressaI was inserting an Openlayers map block with a contextual filter in a node, with a tool tip using
<entire node>under "Description Content". This rendered the teaser, which was the node itself, so that was a node-inside-a-node situation.After de-selecting
<entire node>and set "Description Content" to nothing, the map shows up, and no more errors. DS rocks :-)Comment #13
davvid commentedIn my case I got error while indexing items with Search API (Solr).
In node display mode (Full) I have DS field with function to render view.
There is filed (reference to node) in this view which was set to display rendered node in display mode which doesn't exist. That was the problem even that the fileld was hidden.
Comment #14
drupst commenteddiff --git a/ds.field_ui.inc b/ds.field_ui.inc
index 548bb91..26cbdc1 100644
--- a/ds.field_ui.inc
+++ b/ds.field_ui.inc
@@ -1295,6 +1295,10 @@ function _ds_field_ui_table_layouts($entity_type, $bundle, $view_mode, &$form, $
$options = array();
$ds_layout_settings = ctools_export_crud_load_all('ds_layout_settings');
foreach ($ds_layout_settings as $row) {
+ // Do not clone from form layouts.
+ if ($row->view_mode == 'form') {
+ continue;
+ }
if ($row->entity_type == $entity_type && !isset($row->settings['ds_panels'])) {
$options[$row->id] = drupal_ucfirst($row->entity_type) . ' > ' . drupal_ucfirst($row->bundle) . ' > ' . drupal_ucfirst($row->view_mode);
}
diff --git a/ds.layout.inc b/ds.layout.inc
index 0ca60b5..3fe9d37 100644
--- a/ds.layout.inc
+++ b/ds.layout.inc
@@ -60,3 +60,18 @@ function ds_layout_list() {
return $build;
}
+
+/**
+ * Emergency page
+ */
+function ds_emergency() {
+
+ $form['ds_disable'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Disable theming through Display suite'),
+ '#description' => t('In case you get an error after configuring a layout with DS which prints something like "Fatal error: Unsupported operand types", you can temporarily disable all DS theming by toggling this checkbox. In that case, you probably are trying to render an node inside a node, for instance through a view, which is simply not possible. See http://drupal.org/node/1264386.'),
+ '#default_value' => variable_get('ds_disable', FALSE),
+ );
+
+ return system_settings_form($form);
+}
diff --git a/ds.module b/ds.module
index 827d6e1..0433633 100644
--- a/ds.module
+++ b/ds.module
@@ -69,6 +69,16 @@ function ds_menu() {
'file path' => drupal_get_path('module', 'system'),
);
+ // Emergency page
+ $items['admin/structure/ds/emergency'] = array(
+ 'title' => 'Emergency',
+ 'description' => 'Temporarily disable theming via Display suite.',
+ 'page callback' => 'drupal_get_form',
+ 'page arguments' => array('ds_emergency'),
+ 'access arguments' => array('admin_display_suite'),
+ 'file' => 'ds.layout.inc',
+ );
+
// Custom styles.
$items['admin/structure/ds/styles'] = array(
'title' => 'Styles',
@@ -614,6 +624,16 @@ function ds_get_field_value($key, $field, $entity, $entity_type, $bundle, $view_
function ds_field_attach_view_alter(&$build, $context) {
static $loaded_css = array();
+ // Global kill switch. In some edge cases, a view might
+ // be inserted into the view of an entity, in which the
+ // same entity is available as well. This is simply not
+ // possible, so you can temporarily disable DS completely
+ // by setting this variable, either from code or via
+ // the UI through admin/structure/ds/
+ if (variable_get('ds_disable', FALSE)) {
+ return;
+ }
+
// If views and core doesn't send information along on the entity,
// Display suite doesn't have a context to render the fields.
if (!isset($build['#entity_type']) && !isset($build['#bundle'])) {
diff --git a/modules/ds_extras/ds_extras.module b/modules/ds_extras/ds_extras.module
index aa73875..2ceeb5f 100644
--- a/modules/ds_extras/ds_extras.module
+++ b/modules/ds_extras/ds_extras.module
@@ -13,7 +13,7 @@ function ds_extras_menu() {
$items['admin/structure/ds/extras'] = array(
'title' => 'Extras',
- 'description' => 'Configure extra functionality for Display Suite.',
+ 'description' => 'Configure extra functionality for Display suite.',
'page callback' => 'drupal_get_form',
'page arguments' => array('ds_extras_settings'),
'access arguments' => array('admin_display_suite'),
Comment #15
skribbz14 commentedThis error is caused, sometimes, when a node is rendering a view and that view is also displaying that same node.
Example:
You're on the most recent blog post page and you want to render a view to display the five most recent blog posts. This blog post would be within that list.
If you tell the view to not include the current node within the list this will fix the issue. This is also better, because I doubt the user wants to click a link to a page they are already on.
This will show you how to do that:
https://www.drupal.org/node/131547
Comment #16
MarkBGH commented#15 did the trick for me!
I was trying to figure out why it was only happening on new nodes, and it was because I had a view that displayed all of the "Latest" posts in a sidebar of those node pages. Thanks for the life saving tip skribbz14!
Comment #17
ryan258 commentedProps to #15!
I was redoing the views/referencing and sure enough I had to blast out an old view that was relying on a reference field I had removed. Once I got rid of the one that shouldn't exist everything of that content type clicked and there was no more
Fatal error: Unsupported operand types in /modules/node/node.module on line 1419
I guess it would be better form to clean up the views/contexts before blasting fields out of content types :)
Comment #18
rcodina#15 works for me too. Thank you so much!
Comment #19
kyuubi commentedI am having this problem as well.
Is this caused by Display Suite?
I don't see why we shouldn't be able to have 2 nodes appear time on the same page without breaking the site.
Anyone has more info on this?
Comment #20
rcodina@kyuubi I think this is not caused by Display Suite, it is just you can't display the same node twice. In my case, I was using Views module to display related nodes of one node and I had to make sure the same node wouldn't appear in that view to avoid the problem.
Comment #21
kyuubi commented@rcodina I just use Drupal core displaying the same node twice presents no issues.
Only seems to become a problem with DS enabled.
Comment #22
rcodina@kyuubi In my case, DS wasn't the problem. My problem was the one described in #15:
So maybe this is a Views problem.
Comment #23
brandonc503 commentedi added a dynamic field of entity > render node and got WSOD with
Fatal error: Unsupported operand types in /drupal/modules/node/node.module on line 1415
Comment #24
aspilicious commentedYou can't embed the same node inside the current node....
That's probably your issue.
Comment #25
aspilicious commentedComment #26
rp7 commentedI ran into this issue as well. I wanted to show the teaser view mode in a field, in the full view mode of the node.
I ended up creating a custom Display Suite field, with the following code:
Comment #27
leon kessler commentedRan into this as well (trying to embed an entity into itself using a DS dynamic field).
I digged around in core, turns out it's totally fine to embed a node within a node (just don't embed the same view mode, or it will obviously break the entire internet!)
I found that this code in
node_view()that was causing the issue:Now I'm not entirely sure why this is needed, but the rather casual language of "We don't need" makes me think it may not be too critical (as apposed to say "Ensure there is no").
Anyhow, there's an easy way to add back in the
$node->content, property. Do so like this...I'm only targeting a specific view mode here, just to try and prevent this hackery from inflicting any damage elsewhere.
Likewise the same goes for taxonomy terms...
Comment #28
elektrorl commented#27 works well in custom module or in template.php. Don't forget to change 'my_view_mode' with 'teaser' for example.