We are using the Migrate module to migrate content from a Drupal 6 site to a Drupal 7 version of the site and as part of that we are migrating various Imagefield fields. These imagefields also have Filefield Paths settings for subdirectories and so during the file migrations code in Filefield Paths is getting called.
Our target environment is Ubuntu 10.4 LTS which is what Acquia uses on its appservers. This version of Ubuntu uses PHP 5.3.2. There is a problem with the PHP parse_url() function that was only corrected in PHP 5.3.3+ as noted in the docs:
http://php.net/manual/en/function.parse-url.php
5.3.3 Removed the E_WARNING that was emitted when URL parsing failed.
One of the parse_url() calls in Filefield Paths that happens during our migration for a single imagefield fails on servers with PHP 5.3.2 but works just fine in later versions of PHP. This makes sense given that in 5.3.2 PHP was triggering a warning that the Migrate module code interprets as as error and halts the migration.
The patch attached simply adds the '@' in front of the offending parse_url() call in order to suppress the warning in PHP 5.3.2. With this change the migrations work as intended just as they do on PHP 5.3.3+.
Comment | File | Size | Author |
---|---|---|---|
#1 | filefield_paths-php53-parse_url-1810236-1.patch | 739 bytes | jaydub |
filefield_paths-php53-parse_url.patch | 726 bytes | jaydub | |
Comments
Comment #1
jaydub CreditAttribution: jaydub commentedReroll as patch doesn't apply anymore
Comment #2
Deciphered CreditAttribution: Deciphered commentedIf possible, can you provide me with some test code so that I can see this issue in the wild? While I have no doubt that the patch will fix the issue, it seems like a bandaid instead of a fix.
Comment #3
Deciphered CreditAttribution: Deciphered commentedComment #4
neRok CreditAttribution: neRok commentedNo more info provided for this issue, so closing.
If anyone needs to implement this fix for a migration, which is only a 1 time event anyway (and only needed for some versions of PHP), they can simply edit their module.