The function ds_extras_preprocess_field() adds theme hook suggestions for '#theme' => 'field' based on the "field template" or "field theme function" setting (the feature is not clearly named).
The code is a bit more confusing than necessary, it is not DRY.
There is also a misbehavior to be fixed:
If the field instance field template is set to "Drupal default", ds will use the globally configured field template, instead of sticking to Drupal default.
Fixing this and cleaning it up will leave us with cleaner-looking and more reliable code.
Patch will follow.
Comments
Comment #2
donquixote commentedComment #3
donquixote commentedI made this with
git format-patchfor a nicer diff.Comment #4
donquixote commentedAdded inline comments.
Refactored building of the
$configarray.Comment #5
donquixote commentedRemoving unused
$layout = ds_get_layout($entity_type, $bundle, $view_mode);.