While migrating a D6 site to D8, I discovered that several imagecache presets were not being migrated.
Somehow, the legacy database had entries in the imagecache_action table with with blank "action" values. I don't know how they got there; we didn't tamper with the database. But the imagecaches work correctly.

These rows caused an exception which aborted that row
The "" plugin does not exist.
Rather than let those - otherwise valid - entries fail, we can filter the bad data out of the query in the first place.
Patch to be attached in first comment.
Steps to reproduce:
1. Create a D6 site.
2. Install imagecache
3. Create one or more presets.
4. Cause an action to have a blank "action" field in the imagecache_action table
5. Migrate the site to D8
Expected result:
The imagecache preset will exist as an image style in the d8 site.
Actual result:
drush mmsg shows an error saying The "" plugin does not exist.
The preset is not migrated.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 2890514-8.patch | 1.43 KB | quietone |
| #8 | 2890514-8-fail.patch | 753 bytes | quietone |
| #5 | 2890514-5.patch | 2.84 KB | quietone |
| #2 | image-upgrade_d6_imagecache_preset-fails-on-blank-action-2890514-1-8.3.4.diff | 645 bytes | vomitHatSteve |
| imagecache.png | 26.73 KB | vomitHatSteve |
Comments
Comment #2
vomitHatSteve commentedAttached is a patch to alter the actions query to exclude results with blank action values.
Comment #3
quietone commentedadd tag.
Comment #4
heddnNW for adding tests.
Comment #5
quietone commentedOn the principle that all the data should be retrieved how about we do this 'skipping' in the process plugin. In general a process plugin should be validating the data anyway, or perhaps a skip_on_empty in the pipeline. The latter option isn't used because the process plugin loops through the data.
The process plugin simply does not process the array of image cache information if the action is empty. An entry is added to the imagecache_action table where the action = '';
Comment #6
quietone commentedComment #7
heddnSo we don't have to shift everything out, let's do a continue if empty(). That would make the whitespace changes a lot cleaner. It also might be good to have a fixtures only change added so we can see how the tests fail.
Comment #8
quietone commentedFix for #7 and a fail patch.
Comment #10
heddnWe've got tests. The IS is in good shape. Let's move along here.
Comment #11
alexpottCommitted and pushed 820c3d83a3 to 8.8.x and 530642fa4f to 8.7.x. Thanks!
AS a bugfix with no BC concerns backporting to 8.7.x
Comment #14
alexpott