? 552938.patch
? cc.class.php-fix-metadata-array.patch
? fix-license-message.patch
Index: creativecommons.class.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/creativecommons/creativecommons.class.php,v
retrieving revision 1.3.4.34
diff -u -p -r1.3.4.34 creativecommons.class.php
--- creativecommons.class.php	17 Aug 2009 18:52:56 -0000	1.3.4.34
+++ creativecommons.class.php	18 Aug 2009 23:24:27 -0000
@@ -322,6 +324,20 @@ class creativecommons_license {
   }
 
   /**
+   *
+   * @return string
+   *   error message for invalid or disabled license
+   */
+  function get_license_unavailable_message() {
+    $args = array('@license-name' => $this->get_name());
+    if ($this->is_valid()) {
+      return t('The license "@license-name" is not enabled.', $args);
+    } else {
+      return t('"@license-name" is not a valid license.', $args);
+    }
+  }
+
+  /**
    * Return true if this license allows commercial use, false otherwise.
    */
   function permits_commercial_use() {
@@ -512,7 +528,7 @@ class creativecommons_license {
       drupal_set_message(t('A node must be specified to save a license.'), 'error');
     }
     else if (!$this->is_available()) {
-      $message = t('The %license-name license is not enabled.', array('%license-name', $this->get_name()));
+      $message = $this->get_license_unavailable_message();
       drupal_set_message($message, 'error');
     }
     else {
Index: creativecommons.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/creativecommons/creativecommons.module,v
retrieving revision 1.9.2.53
diff -u -p -r1.9.2.53 creativecommons.module
--- creativecommons.module	17 Aug 2009 18:52:56 -0000	1.9.2.53
+++ creativecommons.module	18 Aug 2009 23:24:27 -0000
@@ -249,9 +249,7 @@ function creativecommons_site_defaults()
 
   // Check to see if default license is still enabled
   if ($cc && $cc->has_license() && !$cc->is_available()) {
-    $args = array();
-    $args['%license-name'] = $cc->get_name();
-    $message = $cc->is_valid() ? t('The %license-name license is not enabled.', $args) : t('%license-name is not a valid license.', $args);
+    $message = $cc->get_license_unavailable_message();
     drupal_set_message($message, 'warning');
   }
 
@@ -487,14 +485,15 @@ function creativecommons_select_license_
 
     // Case 1: License is no longer available
     if (!$desired_license->is_available()) {
-      $message = t('The %license-name license is not enabled.', array('%license-name' => $desired_license->get_name('generic'))) .' '. t('Please review license selection.');
+      $args = array('@license-name' => $desired_license->get_name('generic'));
+      $message = t('The @license-name license is not enabled.', $args) .' '. t('Please review license selection.');
     }
     // Case 2: Jurisdiction change (same license type)
     elseif ($desired_license->jurisdiction != $selected_license->jurisdiction) {
       $args = array();
-      $args['%old-jurisdiction'] = $jurisdictions[$desired_license->jurisdiction];
-      $args['%new-jurisdiction'] = $jurisdictions[$selected_license->jurisdiction];
-      $message = t('License jurisdiction will be changed from %old-jurisdiction to %new-jurisdiction.', $args) .' '. t('Please review license selection.');
+      $args['@old-jurisdiction'] = $jurisdictions[$desired_license->jurisdiction];
+      $args['@new-jurisdiction'] = $jurisdictions[$selected_license->jurisdiction];
+      $message = t('License jurisdiction will be changed from @old-jurisdiction to @new-jurisdiction.', $args) .' '. t('Please review license selection.');
     }
     // Case 3: Version change (upgrade)
     elseif ($desired_license->version != $selected_license->version) {
@@ -551,10 +550,7 @@ function creativecommons_validate_licens
   // Check to see if selected license is available
   $cc = new creativecommons_license($license_uri);
   if ($cc->has_license() && !$cc->is_available()) {
-    $args = array();
-    $args['%license-name'] = $cc->get_name();
-    $message = $cc->is_valid() ? t('The %license-name license is not enabled.', $args) : t('%license-name is not a valid license.', $args);
-
+    $message = $cc->get_license_unavailable_message();
     form_set_error($license_uri_key, $message);
   }
 }
