I'm seeing the error...

Notice: Undefined index: #paragraphs_items_view_mode in template_preprocess_paragraphs_items() (line 12 of /path/to/webroot/sites/all/modules/contrib/paragraphs/theme/paragraphs.theme.inc).

Comments

jstoller created an issue. See original summary.

jstoller’s picture

Status: Active » Needs review
StatusFileSize
new1.87 KB

  • jstoller committed a936865 on 7.x-1.x
    Issue #3094820 by jstoller: Undefined index: #paragraphs_items_view_mode...
jstoller’s picture

Status: Needs review » Fixed

Patch committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

lwalley’s picture

Apologies I have not had time to test this but just wanted to warn that the patch seems to be setting the view mode to a boolean if #paragraphs_items_view_mode is not set - the else is isset($variables['element']['#view_mode']);:

$view_mode = isset($variables['element']['#paragraphs_items_view_mode']) ? $variables['element']['#paragraphs_items_view_mode'] : isset($variables['element']['#view_mode']);

https://git.drupalcode.org/project/paragraphs/-/commit/a9368657327daee8b...

I would expect $view_mode to be a string not a boolean - later in the code it seems to assume it is a string:

$variables['classes_array'][] = drupal_html_class('paragraphs-items-' . $field_name . '-' . $view_mode);

https://git.drupalcode.org/project/paragraphs/-/commit/a9368657327daee8b...