CRM_Badge_Form_Layout - (Partially) Fix loading with alternate packages path
authorTim Otten <totten@civicrm.org>
Wed, 15 Jan 2020 21:48:58 +0000 (13:48 -0800)
committerTim Otten <totten@civicrm.org>
Tue, 28 Jan 2020 23:14:29 +0000 (15:14 -0800)
This change should work as well as before, and it's more correct.  However,
it's not a full fix making the badge-editor work in D8 - the relevant code
probably needs more of a rethink. But... this is cleaner...

CRM/Badge/Form/Layout.php

index 5018dfaf73340181540e127775b93423b8821cfe..25834a190126b3ef3ead8ceb76060fc3decf4b99 100644 (file)
@@ -34,7 +34,7 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form {
     $resources = CRM_Core_Resources::singleton();
     $resources->addSetting(
       [
-        'kcfinderPath' => $config->userFrameworkResourceURL . 'packages' . DIRECTORY_SEPARATOR,
+        'kcfinderPath' => CRM_Utils_File::addTrailingSlash(Civi::paths()->getVariable('civicrm.packages', 'url'), '/'),
       ]
     );
     $resources->addScriptFile('civicrm', 'templates/CRM/Badge/Form/Layout.js', 1, 'html-header');