Problem/Motivation

File fields required 'display' and 'description' otherwise they throw a fatal error at the database layer when being saved. This prevents the entire node being saved.

Running d6_cck_field_values:story                                                                                                                          [ok]
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'field_file_display' cannot be null: INSERT INTO {node__field_file} (entity_id,     [error]
revision_id, bundle, delta, langcode, field_file_target_id, field_file_display, field_file_description) VALUES (:db_insert_placeholder_0,
:db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6,
:db_insert_placeholder_7); Array
(
    [:db_insert_placeholder_0] => 2
    [:db_insert_placeholder_1] => 2
    [:db_insert_placeholder_2] => story
    [:db_insert_placeholder_3] => 0
    [:db_insert_placeholder_4] => und
    [:db_insert_placeholder_5] => 3
    [:db_insert_placeholder_6] =>
    [:db_insert_placeholder_7] =>
)
 (/Users/bendougherty/Sites/d8/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php:913)

Proposed resolution

We need to have per field processing for the file field, we're already introducing something similar for links in #2233883: Link migration needs to convert source url into the appropriate route format for storage

Remaining tasks

Add a test.

User interface changes

API changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

benjy’s picture

Status: Needs review » Postponed
benjy’s picture

Status: Postponed » Needs work

The last submitted patch, filefield-processing.patch, failed testing.

eliza411’s picture

When I try to apply this to 8.0.x (3359738e), it won't apply cleanly and says:

error: core/modules/migrate_drupal/src/Plugin/migrate/process/d6/CckFile.php: No such file or directory

benjy’s picture

Status: Needs work » Needs review
FileSize
2 KB

Just needed a re-roll now the link patch has gone in.

Status: Needs review » Needs work

The last submitted patch, 5: 2394567-5.patch, failed testing.

benjy’s picture

Status: Needs work » Needs review
FileSize
1.96 KB

Try again.

benjy’s picture

Issue tags: +Needs tests
benjy’s picture

Issue summary: View changes
FileSize
8.02 KB
7.4 KB

New patch attached fixes a few issues and updates the dumps so we can add a test.

benjy’s picture

FileSize
8.38 KB
1.79 KB

Updates so we now have support for both the contrib filefield module and core's file attachments, plus an extra test for the target id.

I did however find that the upload field migrations aren't working, opened: #2400827: D6->D8 Upload Field Migrations not working

chx’s picture

Status: Needs review » Reviewed & tested by the community

That looks good.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs tests

Migrate is not frozen in beta. Committed 41a3319 and pushed to 8.0.x. Thanks!

  • alexpott committed 41a3319 on 8.0.x
    Issue #2394567 by benjy: File field need associated metadata during...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.