Closed (cannot reproduce)
Project:
Migrate
Version:
7.x-2.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Aug 2011 at 14:12 UTC
Updated:
2 Apr 2013 at 18:19 UTC
When working with a Migrate into a mysql db for files from mssql, the uri had a special character (em dash in my case) that caused Migrate to not be able to validate the file. This is fine, except when it generated the message with the uri included, the special character was not filtered out causing saveMessage in sqlmap.inc to fail making the root cause difficulty to find.
Comments
Comment #1
mikeryanWhat precisely was the failure message in sqlmap.inc?
Comment #2
reujwils commentedThe message that pop's up via the UI is:
An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /batch?render=overlay&id=88&op=do StatusText: Service unavailable (with message) ResponseText: PDOException: in MigrateSQLMap->saveMessage() (line 303 of /var/www/html/sites/all/modules/migrate/plugins/sources/sqlmap.inc).
I'll try to replicate the error in my dev box to get the exact detail, but from what I remember, when I debugged the source and intercepted the saveMessage call, the message had the full uri (i.e. public://pictures/.....), I think it was 'Unable to copy file from public://pictures/....' and the resulting uri had the \x96 character causing the message insert to fail.
Of course I modified my migration to replace the special characters in the uri, but it just slowed me down with the more unsual service unavailable message from above.
I'll track down the exact line for you, but let me know in the meantime if this is or isn't clear.
Thanks!
Comment #3
reujwils commentedForgot to update the status after I supplied more info as requested.
Comment #4
mikeryanRunning in drush with -d may be more useful (like, maybe we would be able to see the specific PDOException being generated).
Comment #5
mikeryanNo further information provided.
Comment #6
msbrar commented"Unable to copy files from" with special characters in the file name still occurs. The problem seems with the copyFile function in plugins/destinations/file.inc. The method assumes that the sourcePath is an unencoded URI. However if the migrated source path is already a well encoded URI, the method encodes it again causing the special characters like % to be reencoded as %25 breaking the path.
There should be an option to tell if the source URI is already a well encoded URI or not. I added the marked lines in this method and it started working for me. Could you please validate the approach.
Comment #7
mikeryanPlease don't reopen long-closed issues. And please do check the issue queue before adding new issues. See #1856694: Local files and rawurlencode() don't work correctly in MigrateFileUri.