As stated in the snippet below, the save function uses $_POST to get to the license data and this is not the Drupal way. Instead, it should get the data from the $node object. A case where this causes a bug is when an action is triggered to update a node and there is no POST data.
/**
* Save license/node relationship in database
*/
function creativecommons_save($node, $op) {
//TODO: shouldn't be using $_POST... what's the drupal way to do this? use submit instead?
$cc = new creativecommons_license($_POST['creativecommons']['select_license_form']['cc_license_uri'], $_POST['creativecommons']['metadata']);
$cc->save($node->nid, $op);
}
Comments
Comment #1
toemaz commentedThe fix:
Comment #2
toemaz commentedHere is the patch.
Comment #3
turadg commentedExcellent, thanks.