Merge pull request #1923 from civicrm/4.3
[civicrm-core.git] / CRM / Extension / Container / Basic.php
index 696700b8175a0af1c2f168bf011e12a012b8d660..cbed89e65c595ee8d7a370dff06f48787616142f 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.4                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2013                                |
  +--------------------------------------------------------------------+
@@ -109,7 +109,6 @@ class CRM_Extension_Container_Basic implements CRM_Extension_Container_Interface
       );
     }
     if (empty($this->baseUrl)) {
-      dpm($this);
       $errors[] = array(
         'title' => ts('Invalid Base URL'),
         'message' => ts('An extension container has been defined with a blank URL.'),
@@ -137,6 +136,16 @@ class CRM_Extension_Container_Basic implements CRM_Extension_Container_Interface
    * {@inheritdoc}
    */
   public function getResUrl($key) {
+    if (! $this->baseUrl) {
+      CRM_Core_Session::setStatus(
+        ts('Failed to determine URL for extension (%1). Please update <a href="%2">Resource URLs</a>.',
+          array(
+            1 => $key,
+            2 => CRM_Utils_System::url('civicrm/admin/setting/url', 'reset=1'),
+          )
+        )
+      );
+    }
     return $this->baseUrl . $this->getRelUrl($key);
   }