Closed (duplicate)
Project:
Display Suite
Version:
7.x-2.6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Sep 2011 at 14:55 UTC
Updated:
10 Jan 2014 at 08:25 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
swentel commentedsee #1279478: Adding preprocess functions to entity themes that don't exist and accessing block content that doesn't exist.
Comment #2
luco commentedoh ok. I searched by the error message text and was unable to find anything.
thanks!
Comment #3
Bevan commentedThe attached patch fixes the issue by including it inside the subsequent if-clause that checks
isset($block['content'])as well as pre-existingis_array($block['content']), and merging the remaining checks for$contextualandisset($block['content']['#contextual_links'])into a single if-clause.The patch was rolled on 2.4 but I expect will apply fine to 2.6.
Comment #4
aspilicious commentedA patch has been committed. Can you try latest dev and see if your patch is still needed.
Comment #5
Bevan commentedAh I see! I should have checked 7.x-2.x-dev first. I only checked 7.x-2.6.
I didn't test the code but I can see by reading it that it is fixed because
ds_render_block_field()now checksisset($block['content'])beforeis_array($block['content']).FYI, the patch takes this a step further by de-duplicating the two occurrences of
isset($block['content']) && is_array($block['content'])and merging the remainingif (isset($block['content']['#contextual_links']))andif ($contextual)clauses into oneifclause.I have set this back to "Needs review" in case you want to do that refactoring, but I am equally happy to close this as duplicate or fixed.
FWIW, #1279478 from comment #1 did not fix this issue.
Comment #6
aspilicious commentedDuplicating, not going to fix that now. :)
Comment #7
dent_arthur_dent commentedFor me, this was happening when I entered something into the search field on my home page so I'm assuming it was trying to render a DS layout before it was defined. My error happened at line 878. What I did to eliminate the error is to add a condition in the IF statement prior to the other conditions to ensure that "$block['content']" was set.
Original line of code:
if (is_array($block['content']) && isset($block['content']['#contextual_links'])) {
My line of code:
if (isset($block['content']) && is_array($block['content']) && isset($block['content']['#contextual_links'])){
I hope that helps some folks out.
Cheers!