Comment by klausi here https://www.drupal.org/node/2386275#comment-9618711:

shariff_field_formatter_view(): don't use #markup and theme() here, just return a render array in $element (Drupal core will render later for you and it is best to keep structured arrays as long as possible for alttering by other modules).

Comments

criz’s picture

Assigned: Unassigned » criz

  • criz committed 228910a on 7.x-1.x
    Issue #2426801: Do not use #markup and theme() in...
criz’s picture

Status: Active » Fixed

I am not sure about this, the field example module is using '#type' => 'html_tag' : https://api.drupal.org/api/examples/field_example%21field_example.module...

But theme_html_tag doesn't really makes any sense to me in this case (only for rendering html meta tags) and I prefer to use our own theme function for consistency. So I used #theme => 'shariff' and changed $settings to be used as render_variables.

http://cgit.drupalcode.org/sandbox-criz-2385117/commit/?id=228910a

Status: Fixed » Closed (fixed)

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