Custom file directory should not be stored as part of filename
Created by: JoeMurray
The custom file directory should not be prepended to the filename at https://github.com/jake-mw/CDNTaxReceipts/blob/master/CRM/Cdntaxreceipts/Form/Settings.php#L153 as that makes the setting break when the site is moved. If you store just the filename, and then pull in the directory when it is being used, sites with this extension will be able to be moved using the normal process for migrating CiviCRM.
For those wondering how to correct the issue after moving site and getting errors, try the following two queries:
UPDATE civicrm_setting SET value='s:[string length]:"[full path to your file]";' WHERE name='receipt_logo'; UPDATE civicrm_setting SET value='s:[string length]:"[full path to your file]";' WHERE name='receipt_signature';
Note a couple of things: you are modifying a serialized PHP value for a string variable, so you'll need to ensure a) you get the string length correct, and b) you don't want to skip the semicolon at the end of the value. Normally you only need to change the path to your upload directory to match that of the new server. I would recommend putting the old and new paths on two lines in an editor with fixed length, then counting the difference in the length of the path, then adding or subtracting the difference from the existing string length value.