Commit 6023052c authored by alexpott's avatar alexpott

Issue #2035697 by Dave Reid: Fixed Entity reference formatter should default...

Issue #2035697 by Dave Reid: Fixed Entity reference formatter should default to the 'Default' view mode.
parent 9e4991d6
......@@ -25,7 +25,7 @@
* "entity_reference"
* },
* settings = {
* "view_mode" = "",
* "view_mode" = "default",
* "link" = FALSE
* }
* )
......@@ -37,7 +37,7 @@ class EntityReferenceEntityFormatter extends EntityReferenceFormatterBase {
*/
public function settingsForm(array $form, array &$form_state) {
$view_modes = entity_get_view_modes($this->getFieldSetting('target_type'));
$options = array();
$options = array('default' => t('Default'));
foreach ($view_modes as $view_mode => $view_mode_settings) {
$options[$view_mode] = $view_mode_settings['label'];
}
......@@ -67,6 +67,9 @@ public function settingsSummary() {
$view_modes = entity_get_view_modes($this->getFieldSetting('target_type'));
$view_mode = $this->getSetting('view_mode');
if ($view_mode == 'default') {
$view_mode = t('Default');
}
$summary[] = t('Rendered as @mode', array('@mode' => isset($view_modes[$view_mode]['label']) ? $view_modes[$view_mode]['label'] : $view_mode));
$summary[] = $this->getSetting('links') ? t('Display links') : t('Do not display links');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment