This module is running on my installation of the latest release candidate (4.6). It seems to work with Drupal 4.6 so far. I just dropped the module back into the new installation with my upgraded database and everything seems to work. Any ideas of what might need to be changed with this module to iron out any problems when it's used with 4.6? I'll post again if I run into errors, but I thought someone else might be able to anticipate problems I haven't encountered. Thanks for any input.

CommentFileSizeAuthor
#2 copyright_4_7.module27.09 KBbomarmonk

Comments

bomarmonk’s picture

Title: Copyright and Drupal 4.6 (CVS) » Copyright and Drupal 4.7 (CVS)?

Maybe I can simply use the existing module with 4.7? I'll post after I've tried.

bomarmonk’s picture

StatusFileSize
new27.09 KB

Well, Copyright will essentially work to some level with 4.7, but the forms-api needs to be updated. Here are my efforts so far, but my code is broken and needs fixing (I am not a coder). I've used the forms updater module to hammer out the arrays for the forms API. I don't see how anyone would want to do anything like this mannualy-- there are a lot of forms with this module.

So I replaced the form calls with the arrays that are spat out by this cool module. Copyright still doesn't work, but I hope I at least I did the grunt work and someone can easily polish this off.

Here are some odd things with my changes:

First:

Drupal 4.6:
form(form_item(t('Delete copyright/license "%name"', array('%name' => $copyright->name)), $form, t('Are you sure you want to delete the copyright/license?')));

Drupal 4.7:
$output = drupal_get_form('copyright_delete', $form);

Obviously the suggested replacement doesn't get the job done. Any ideas? Please fix and add to this.

Second:

Drupal 4.6:
form_checkboxes(t('Node types allowing individual copyright selection'), 'nodes', explode(',', variable_get('copyright_nodetypes', '')), $nodetypes, t('Node types for which posters can choose their own copyright/license from the list of defined licenses.'));

Drupal 4.7:

$form['nodes'] = array(
  '#type' => 'checkboxes',
  '#title' => t('Node types allowing individual copyright selection'),
  '#default_value' => explode(',', variable_get('copyright_nodetypes', '')),
  '#options' => $nodetypes,
  '#description' => t('Node types for which posters can choose their own copyright/license from the list of defined licenses.'),
);

The output from my wonderful forms module tells me:
4.7 deals with the return values of checkboxes differently. 4.6 returned an array where the values were the checkbox keys. 4.7 returns an array where the key is the checkbox key and the value is the value (by default: checked = 1, unchecked = 0). You will need to adjust your form handler appropriately. You can use array_keys() on the checkbox array to get old-style values.

I don't know how to do this. Any suggestions?

The other issues are these fieldsets. They look simple enough, but are they right?

Drupal 4.6:
form_group(t('License'), $group);

Drupal 4.7:

$form[] = array(
  '#type' => 'fieldset',
  '#title' => t('License'),
);

Drupal 4.6:
form_group(t('Copyright'), $form);

Drupal 4.7:

$form[] = array(
  '#type' => 'fieldset',
  '#title' => t('Copyright'),
);

I've attached my work. I hope it helps update this module!

bomarmonk’s picture

Status: Active » Needs work
jw867’s picture

Got an error when I added the CVS version to the module tree with 4.7.0.

Parse error: syntax error, unexpected $end in /var/www/drupal/modules/copyright.module on line 799

bomarmonk’s picture

The update of this module has not been completed (including my patch above-- see my comments). The module hasn't been changed in CVS since Feb. of 2005 (way before 4.7 was a reality). I hope my efforts above help, but someone needs to finish the effort (I'm a little over my head). Thanks to anyone who can finish revising this module so it works with 4.7.

bomarmonk’s picture

Can someone finish the work on this update? I can try, when I have time... but are there any takers?

Robrecht Jacques’s picture

Assigned: Unassigned » Robrecht Jacques
Status: Needs work » Active

I've taken over maintance for copyright.module.

You'll find a version of copyright.module in CVS that should work for 4.7.

Known issues:
- inheriting the copyright in books doesn't seem to work. Need to check how it is suppose to work and fix it.

If you find anything else, please create an issue. I'll release a 4.7 version next week (if there are no major bugs or issues).

Robrecht Jacques’s picture

Version: master » 4.7.x-1.0
Status: Active » Fixed

Please report problems with the 4.7.x-1.0 release as seperate issues.

Anonymous’s picture

Status: Fixed » Closed (fixed)