diff --git a/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php b/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php index b9a145b..03a1d63 100644 --- a/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php +++ b/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php @@ -51,7 +51,7 @@ function setUp() { ); $this->drupalPost('admin/config/regional/content-language', $edit, t('Save')); - /* + /* @todo un-comment when moved to DrupalUnitTestBase. // Enable entity translation for the entity type/bundle. translation_entity_set_config('node', 'page', 'enabled', TRUE); drupal_static_reset(); diff --git a/core/modules/path/path.install b/core/modules/path/path.install index 9b70925..eae337d 100644 --- a/core/modules/path/path.install +++ b/core/modules/path/path.install @@ -9,24 +9,23 @@ * Implements hook_field_schema(). */ function path_field_schema($field) { - $columns = array( - 'pid' => array( - 'description' => 'Foreign Key: The path alias ID from {url_alias}.pid.', - 'type' => 'int', - 'not null' => FALSE, - ), - // This partially duplicates {url_alias}.alias, but contains the actual user - // input, which should be stored per field, to make it an inherent part of - // an entity's life-cycle; e.g., exposing changed values in field revisions. - 'value' => array( - 'description' => 'The user-customizable part of the URL alias.', - 'type' => 'varchar', - 'length' => 255, - 'not null' => FALSE, - ), - ); return array( - 'columns' => $columns, + 'columns' => array( + 'pid' => array( + 'description' => 'Foreign Key: The path alias ID from {url_alias}.pid.', + 'type' => 'int', + 'not null' => FALSE, + ), + // This partially duplicates {url_alias}.alias, but contains the actual user + // input, which should be stored per field, to make it an inherent part of + // an entity's life-cycle; e.g., exposing changed values in field revisions. + 'value' => array( + 'description' => 'The user-customizable part of the URL alias.', + 'type' => 'varchar', + 'length' => 255, + 'not null' => FALSE, + ), + ), 'foreign keys' => array( 'path_url_alias' => array( 'table' => 'url_alias', diff --git a/core/modules/path/path.module b/core/modules/path/path.module index 87f10c1..a4f1f53 100644 --- a/core/modules/path/path.module +++ b/core/modules/path/path.module @@ -326,3 +326,15 @@ function path_library_info() { return $libraries; } + +/** + * Implements hook_form_FORM_ID_alter() for field_ui_field_settings_form(). + */ +function path_form_field_ui_field_settings_form_alter(&$form, $form_state) { + if ($form['#field']['type'] == 'path') { + // We only support having one path at the entity so it doesn't make sense + // to let the site builder choose anything else. + $form['field']['container']['cardinality']['#options'] = drupal_map_assoc(array(1)); + $form['field']['container']['#access'] = FALSE; + } +}