When I run the migration from drupal 7 to drupal 8 the images transfer to the new public directory but are not linked inside the nodes. Can someone help me with this?

CommentFileSizeAuthor
#5 Capture.PNG26.65 KBbloomt
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bloomt created an issue. See original summary.

quietone’s picture

Hmm, I'm seeing this too, both from GUI and from drush. My test was only one node with an image field. The file is copied but there is no entry in file_managed. User picture files migrated and displayed correctly with users.

mikeryan’s picture

Component: Documentation » Code
Category: Support request » Bug report
Priority: Normal » Major

I think there are two different experiences reported here - @bloomt is reporting links to files from inside a node body not working, while @quietone reports file_managed not being populated (and thus the image field not being populated). I just did a test myself with a slightly different experience - the <img> tag within the body works, and file_managed is populated, but the image field is not populated.

Let's have some more information - how are you specifying the source file path? @bloomt, by "linked" do you mean <img> tags to embed the images, or <a href> to link to them? Are the file URIs fully-qualified?

In my case, I provided the site address (http://m7.local:8083/), and inside the node being migrated I had <img src="/sites/default/files/migration_dashboard.jpg" />.

bloomt’s picture

Sorry if I was a little vague with my issue.

My issue is actually that the urls/image link from image fields are not populating but if I look at my files directory the images are transferred.

In other words if I browse to the node that should have the image in the field it shows choose files instead of linking to the existing image that is in the files directory.

Hope that clears it up a bit.

bloomt’s picture

FileSize
26.65 KB
mikeryan’s picture

OK, so that's the same as I'm seeing - the field is not populated. I'm looking into it - most likely a core bug, since it's the core framework actually doing the migration, but I'll see if I can diagnose it before moving it to the core queue.

mikeryan’s picture

Project: Migrate Upgrade » Drupal core
Version: 8.x-1.x-dev » 8.0.x-dev
Component: Code » migration system
Issue tags: +Migrate critical
Parent issue: » #2447727: Add base class for migrating reference fields

The problem is there's nothing translating the incoming 'fid' value to the D8 'target_id'. General work along those lines is going on in #2447727: Add base class for migrating reference fields, moving to a child of that (and maybe closing this as a duplicate if we add file reference handling to that patch).

joergM’s picture

Duplicate to https://www.drupal.org/node/2604484 - patch available

mikeryan’s picture

Status: Active » Closed (duplicate)
Parent issue: #2447727: Add base class for migrating reference fields »
Related issues: +#2604484: Migrate Drupal 7 image and file fields

Ah, thanks for the pointer!

mikeryan’s picture

Status: Closed (duplicate) » Active

Actually, looking at that patch it's not sufficient to make file/image fields work out of the box.

mikeryan’s picture

Status: Active » Closed (duplicate)

Let's pick this up at #2604484: Migrate Drupal 7 image and file fields, where the patch I just added works for me (I was using a file field rather than an image field). Please try that patch and report in that issue what your experience is.

joergM’s picture

I tried the patch and both, file fields and image fields, were migrated successfully.

bloomt’s picture

It's still not working for me, I applied the patch "migrate_drupal_7_image-2604484-10.patch" and the issue is the same. Am I missing something?

joergM’s picture

Drupal needs to know the new configuration (with Image.php).
I got the new Image.php file recognized only after new installation of the site and enabling of migrate and migrate_upgrade modules.
Drush cr does not clear the migration upgrade configuration :-(

mikeryan’s picture

This issue is closed in favor of #2604484: Migrate Drupal 7 image and file fields - please give feedback on the patch in that issue.