Hello!

I installed the module and it works, but I get this warning:

error

Any ideas?

Comments

cubeinspire’s picture

Hi !
That's a notice, not a big issue. This happens because you work on a developpement enviroment. On production notices and other minor information events are not displayed.

This ca be solved by wrapping the code on line 161 by an additional condition like this:

if ( isset($items) ) {
   //The block of code starting at line 161 should go inside here 
}

Right now I'm quite on a rush with my clients but on a more calm down moment I will update a patch.

Thank's a lot for reporting and be sure that the notice won't appear on prod environment.

igasi’s picture

Issue summary: View changes
StatusFileSize
new644 bytes

This issue also get i warning when the body (filed) is empty.

I solved with this patch.

pmchristensen’s picture

StatusFileSize
new687 bytes

Took another approach and made the following patch - does the same as @igasi patch.

It's unclear to me why you (@cubeinspire) doesn't weight notices as a problem :-/

It totally blots watchdog an therefore detroying possibilities to debug on other problems - correct it's not critical, but should be consider as a priority high.

beatnbite’s picture

I have this issue too.

There is a workaround that can fix the issue without hacking into the code of the module:

function HOOK_field_attach_view_alter(&$output, $context)
{
    if (($context['entity_type'] == 'node') && ($context['view_mode'] != 'full')) {
        if (!isset($output['body'])) {
            $node = &$context['entity'];
            $output['body'] = array(
                '#theme' => 'field',
                '#title' => '',
                '#label_display' => 'above',
                '#field_type' => 'text',
                '#field_name' => 'body',
                '#bundle' => $node->type,
                '#object' => $node,
                '#items' => array(0 => array('safe_value' => '')),
                '#entity_type' => 'node',
                '#weight' => 9999,
                0 => array('#markup' => ' '),
            );
        }
   }
}
cubeinspire’s picture

Hi I will do an update of the module asap.
I've been a bit busy those last months...

  • cubeinspire committed 8c98ebe on 7.x-1.x
    Issue #1909372 by CreA-dupe: added condition in the case body is empty.
    
cubeinspire’s picture

Status: Needs work » Closed (fixed)

I released a new version with the patch from igasi applied.
Thank you and sorry for the delay.

I'll be much more active now !

cubeinspire’s picture

I released a new version with the patch from igasi applied.
Thank you and sorry for the delay.

I'll be much more active now !