Hi, running a d6 migration today and the following error is reported. In my case, it is not an error that the table doesn't exist. I guess we display nothing if the table doesn't exist and isn't required?

Importing d6_imagecache_presets
Migration failed with source plugin exception: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'md61.imagecache_preset' doesn't exist: SELECT icp.*                                           [error]
FROM 
{imagecache_preset} icp; Array
(
)

Importing d6_menu

Comments

quietone created an issue. See original summary.

quietone’s picture

Status: Active » Needs review
Issue tags: +Needs tests
StatusFileSize
new596 bytes

Here is a fix but still needs tests. Credit goes to phenaproxima for the fix. I still don't get annotations...

phenaproxima’s picture

The test should rename or drop the ImageCache table, then try to execute the d6_imagecache_presets migration and expect to catch a PDOException. Something like:

$database = get_migration_database()->schema()->dropTable('imagecache_presets');
try {
  $this->executeMigration('d6_imagecache_presets');
  $this->fail('Did not catch expected PDOException.');
}
catch (\PDOException $e) {
  $this->pass('Caught expected PDOException when imagecache_presets table is not present.');
}
phenaproxima’s picture

Issue tags: +Migrate critical

One other thing -- we'll need a fail patch, which includes the exception test but NOT the fix -- which will deliberately fail testbot in order to prove that the problem exists. Then we need another patch that includes the test AND the fix, which should pass testbot, in order to prove that the fix fixes the problem :) When all this is here, I will merrily RTBC.

In the meantime, this prevents people from running full-site D6 migrations if they don't have ImageCache installed, so I'm escalating it to Migrate critical.

phenaproxima’s picture

Title: d6_imagecache_presets reports failure for mising table » d6_imagecache_presets reports failure for missing table
Issue tags: -Migrate critical

Actually, ix-nay on that escalation. This problem only breaks the ImageCache migrations.

quietone’s picture

@phenaproxima, even with your code example I'm not able to make an exception test. Will you PM when you have some time to assist?

quietone’s picture

StatusFileSize
new969 bytes
new1.53 KB

@phenaproxima, two patches here.

  • 255892-7-fail.patch - with your code to drop db and migrate
  • 255892-7-fix-stillfail.patch - as above with the fix

With both patches the exception is thrown and in both cases the execption is caught in MigrateExecutable line 315.

The last submitted patch, 7: 255892-7-fail.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 7: 255892-7-fix-stillfail.patch, failed testing.

phenaproxima’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new2.19 KB

Fixed!

Frankly, the test is pretty pointless because requirements checking is absolutely not limited to the ImageCache source plugin; it's part of all Migrate Drupal source plugins. However, in the interest of buttering up the committers, we can leave the test in, at least for now, since there is (as far as I know) no other, extensive coverage of checkRequirements().

quietone’s picture

thx, phenaproxima. I see what I did wrong.

+1 RTBC

phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community

I'll take your "+1 RTBC" to mean "full-fledged RTBC". :)

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 10: 2558927-10.patch, failed testing.

lostkangaroo’s picture

lostkangaroo’s picture

Status: Needs work » Needs review

Interesting double feature

lostkangaroo’s picture

Status: Needs review » Reviewed & tested by the community

Pending testbot

anavarre’s picture

Thanks @quietone for pointing me to this issue. I can also confirm it fixes the error for me on a vanilla D6 site with no ImageCache installed.

webchick’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +rc eligible

Nice one, heard someone at DrupalCon raising this issue while trying to test D6 -> D8, glad to see it fixed + test coverage.

Since these changes are self-contained against an experimental module, I believe that makes this eligible for commit during RC. Tagging.

Committed and pushed to 8.0.x. Thanks!

  • webchick committed 961bf74 on 8.0.x
    Issue #2558927 by quietone, phenaproxima, lostkangaroo, anavarre:...

Status: Fixed » Closed (fixed)

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