CRM_Extension_Container_Basic - Display warning if no resource URL is defined
authorTim Otten <totten@civicrm.org>
Mon, 7 Oct 2013 12:09:51 +0000 (13:09 +0100)
committerTim Otten <totten@civicrm.org>
Mon, 7 Oct 2013 12:09:51 +0000 (13:09 +0100)
CRM/Extension/Container/Basic.php

index ee503fd803072906fbd957f061cef683330cbb64..cbed89e65c595ee8d7a370dff06f48787616142f 100644 (file)
@@ -136,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);
   }