Title says it all, patch coming up.

Use this core issue to run the tests: #1735118: Convert Field API to CMI

Files: 

Comments

StatusFileSize
new34.49 KB

StatusFileSize
new43.17 KB

Field tests turn green, going to run this patch also over at #1735118: Convert Field API to CMI to see what the testbot says for all the rests.

StatusFileSize
new43.21 KB

Forgot something small thing, new patch.

Status:Active» Needs work

+++ b/core/modules/field/field.attach.incundefined
@@ -1276,20 +1276,27 @@ function field_attach_create_bundle($entity_type, $bundle) {
+      config($old_config_identifier)->delete();
+      field_create_instance($config_instance);

I think that the save come before the delete just in case the delete fails.

+++ b/core/modules/field/field.attach.incundefined
@@ -1276,20 +1276,27 @@ function field_attach_create_bundle($entity_type, $bundle) {
+  config('field.bundle-settings.' . $entity_type . '.' . $bundle_old)->delete();
+  field_bundle_settings($entity_type, $bundle_new, $settings);

As above. Perhaps config's storageInterface should support renames?

+++ b/core/modules/field/field.crud.incundefined
@@ -285,9 +285,8 @@ function field_update_field($field) {
+  config('field.field.' . $field['field_name'])->set('conf', $field)->save();

We could use setData here instead of adding the unnecessary level 'conf'

conf:
    active: '1'
    cardinality: '1'
    columns:
        format:
            length: '255'
            'not null': '0'
            type: varchar
        summary:
            'not null': '0'
            size: big
            type: text
        value:
            'not null': '0'
            size: big
            type: text
    deleted: '0'
    entity_types:
        - node
    field_name: body
    'foreign keys':
        format:
            columns:
                format: format
            table: filter_format
    id: 65668d
    indexes:
        format:
            - format
    locked: '0'
    module: text
    settings: {  }
    storage:
        active: '1'
        module: field_sql_storage
        settings: {  }
        type: field_sql_storage
    storage_active: '1'
    storage_module: field_sql_storage
    storage_type: field_sql_storage
    translatable: '0'
    type: text_with_summary

Above is a dumped field contains duplicated data storage array vs storage__NAME_ - swentel says this is happening due to an array stored as a serialised string in the database (the data column).

StatusFileSize
new50.72 KB

This patch implements the hook_config_import_create/update/delete functions.
It fixes the file_managed table as well

Nothing done yet from the comments in #4

Cheated for the node type test at this point.
Also we need to cast the allowed values to strings so they preserve order

Status:Needs work» Closed (duplicate)

I've created a branch 1735118-field-cmi-swentel in http://drupal.org/sandbox/yched/1736366 - see http://drupalcode.org/sandbox/yched/1736366.git/shortlog/refs/heads/1735...

This issue has been deprecated in favour of #1735118: Convert Field API to CMI