Commit f0540465 authored by catch's avatar catch

Issue #1824180 by fubhy: Fixed Undefined variable () in Field UI module.

parent a115f083
......@@ -279,3 +279,11 @@ function field_test_field_formatter_settings_form_alter(&$element, &$form_state,
function field_test_field_formatter_settings_summary_alter(&$summary, $context) {
$summary .= '<br />field_test_field_formatter_settings_summary_alter';
}
/**
* Implements hook_field_extra_fields_alter().
*/
function field_test_field_extra_fields_alter(&$info) {
// Remove all extra fields from the 'no_fields' content type;
unset($info['node']['no_fields']);
}
......@@ -63,7 +63,7 @@ public function form(array $form, array &$form_state) {
);
if (empty($instances) && empty($extra_fields)) {
drupal_set_message(t('There are no fields yet added. You can add new fields on the <a href="@link">Manage fields</a> page.', array('@link' => url($admin_path . '/fields'))), 'warning');
drupal_set_message(t('There are no fields yet added. You can add new fields on the <a href="@link">Manage fields</a> page.', array('@link' => url($this->adminPath . '/fields'))), 'warning');
return $form;
}
......
......@@ -178,6 +178,20 @@ function testSingleViewMode() {
$this->drupalPost('admin/config/people/accounts/display', array(), t('Save'));
}
/**
* Tests that a message is shown when there are no fields.
*/
function testNoFieldsDisplayOverview() {
// Create a fresh content type without any fields.
$this->drupalCreateContentType(array('type' => 'no_fields', 'name' => 'No fields'));
// Remove the 'body' field.
field_delete_instance(field_info_instance('node', 'body', 'no_fields'));
$this->drupalGet('admin/structure/types/manage/no_fields/display');
$this->assertRaw(t('There are no fields yet added. You can add new fields on the <a href="@link">Manage fields</a> page.', array('@link' => url('admin/structure/types/manage/no_fields/fields'))));
}
/**
* Asserts that a string is found in the rendered node in a view mode.
*
......
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