This error shows up when displaying a view that should show a media image field. This is a clean install on Drupal 7 dev as from August 2nd.
The view displays content of type 'referentie' with one field called 'pic' which is of type 'multimedia asset'.

Below is the views export:


$view = new view;
$view->name = 'pics';
$view->description = '';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 3.0-alpha1;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Defaults */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->display->display_options['access']['type'] = 'none';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* Field: Fields: field_pic */
$handler->display->display_options['fields']['entity_id']['id'] = 'entity_id';
$handler->display->display_options['fields']['entity_id']['table'] = 'field_data_field_pic';
$handler->display->display_options['fields']['entity_id']['field'] = 'entity_id';
$handler->display->display_options['fields']['entity_id']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['entity_id']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['entity_id']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['entity_id']['alter']['trim'] = 0;
$handler->display->display_options['fields']['entity_id']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['entity_id']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['entity_id']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['entity_id']['alter']['html'] = 0;
$handler->display->display_options['fields']['entity_id']['hide_empty'] = 0;
$handler->display->display_options['fields']['entity_id']['empty_zero'] = 0;
$handler->display->display_options['fields']['entity_id']['type'] = 'media_small';
/* Filter: Node: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
  'referentie' => 'referentie',
);

/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->display->display_options['path'] = 'pics';
CommentFileSizeAuthor
#11 styles_872518_isset.patch521 bytessimon georges

Comments

dawehner’s picture

Status: Active » Postponed (maintainer needs more info)

Can you please paste the whole error message? There is always a line to the problem.

solide-echt’s picture

Sorry, my stupid mistake...

Notice: Undefined index: #formatter in theme_styles_field_formatter() (line 75 of /Users/ericsol/Documents/webroot/drupal7/sites/all/modules/styles/styles.module).

Styles is version 7.x-1.x-dev, Views is version 7.x-3.x-dev (snapshots from Aug. 2nd).

Eric

dawehner’s picture

Project: Views (for Drupal 7) » Styles
Version: 7.x-3.x-dev » 6.x-1.x-dev
Component: fieldapi data » Code

So.

nedjo’s picture

Version: 6.x-1.x-dev » 7.x-2.x-dev
Status: Postponed (maintainer needs more info) » Active
nedjo’s picture

This error shows up when a display mode is set to "hidden". Presumably there's a need for an isset() test.

Steps to reproduce:

  • Enable media and styles_ui modules.
  • At admin/config/media/types/manage/image/fields, add a new field, Image (field_image), selecting "Multimedia asset" as the field type.
  • At admin/structure/types, create a new content type, Image (image) and add field_image to it.
  • At admin/config/media/types/manage/image/display, for the Image content type, change the format from "Large" to "Small" and save.

Result

  • When viewing a newly created image node, no image is displayed. On the subsequent page load the following error appears:
    Notice: Undefined index: #formatter in theme_styles_field_formatter() (line 11 of /var/www/example/sites/all/modules/styles/themes/styles.theme.inc).
    
cjr_chris’s picture

I have the same issue. Subscribe.

hansfn’s picture

This is kind of a duplicate of #1051090: Revamp file view modes: migrate media_small to teaser, media_large to full, media_preview to preview; deprecate link & original. The problem with Small not displaying is explained inside that bug report. I think Styles should add "Small" to the list of default formatters.

nedjo is of course correct that a test have to be added for the case of a "hidden" formatter or maybe better - add "hidden" to the default formatters in Styles.

rayworld’s picture

same issue here. Subscribe.

cartagena’s picture

Same issue...content I added was a video using media front module with OS media player. Got the same message as #5. Thanks.

andres.torres’s picture

same issue here.

simon georges’s picture

Status: Active » Needs review
StatusFileSize
new521 bytes

If this is so simple, first attempt for a patch

carole’s picture

How do you manually configure a "Small" style?

henrijs.seso’s picture

#11 gets rid of notice, still no images displays with Small style thou.

lundj’s picture

same issue here!

effulgentsia’s picture

Re #11 patch, I'm not sure whether there's a use-case for making theme_styles_field_formatter() validate #formatter other than to work around a Media module bug (which is fixed in dev version of Media now) of calling this theme function with an invalid formatter name. In case there is another use-case, I'm leaving this issue open rather than closing it as a duplicate.

For the specific issue of Media module's Small view mode, see #1051090: Revamp file view modes: migrate media_small to teaser, media_large to full, media_preview to preview; deprecate link & original. If you have UI recommendations about it, please add them to that issue. Thanks.

bluegeek9’s picture

Status: Needs review » Closed (outdated)

Thank you for your contributions to this issue. As Drupal 7 has reached its End of Life and is no longer supported, we are closing this issue. We encourage you to upgrade to a supported version of Drupal.