When CC is turned off for all content types (at admin/settings/creativecommons/types) I still get a 'The license "None (All Rights Reserved)" is not enabled.' message after saving a node.

Comments

mbria’s picture

Same issue here with beta3.

Probably related with:
http://drupal.org/node/574396

mbria’s picture

A temporary solution is remove the warning commenting line 345:

  function get_license_unavailable_message() {
    $args = array('@license-name' => $this->get_name());
    if ($this->is_valid()) {
      //Removed: return t('The license "@license-name" is not enabled.', $args);
    }
    else {
      return t('"@license-name" is not a valid license.', $args);
    }
  }

If licenses are selected with a dropdown from the ones enabled, the only case where it warning will appear is on non CC contenttypes.

As is said this is a temporary solution... a really dirty hack while the original developers fix the issue. :-)

Cheers,

m.

kreynen’s picture

Status: Active » Fixed

This was only an issue when no licenses were enabled, but this is what I did to fix it. First I added return TRUE/FALSE to the creativecommons_licenses_enabled function. That function was only being used to drupal_set_message.

Then in the creativecommons_save function I added logic to check if CC licensing is enabled for this content type AND at least one license is enable.

  if(creativecommons_node_type_is_enabled($node->type) && creativecommons_licenses_enabled()) {
    $cc = new creativecommons_license($cc_license_uri, $metadata);
    $cc->save($node->nid, $op);
  }

If CC licensing is enabled on a content type without enabling licenses, users will see the No Creative Commons license types are enabled! warning, which seems like the logical message.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.