Download & Extend

Copyright being shown in the teaser

Project:Copyright
Version:5.x-1.6
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Hi,
I upgraded copyright module to 5.x-1.5 and I noticed that if I select any copyright other than the site default, the copyright node notice gets displayed in the teaser.

Comments

#1

Possible correction of this bug : the copyright notice must only appear in $page mode.

File : copyright.module ; Line 486 and follow (changes in bold)------


-----------------------------------------------------------------------
function copyright_nodeapi(&$node, $op, $teaser, $page) { // <=== CHANGE
if (variable_get('copyright-enable_'. $node->type, 0)) {
switch ($op) {
case 'view':
if ($page){ // <=== CHANGE
$node_license = copyright_get_node_license($node->nid);
if (!$node_license && $node->parent) {
// $node->parent set at node load time by book.module
$node_license = copyright_parent_node($node->parent);
}
if ($node_license && $node_license->cpyid != variable_get('copyright-default', 1)) {
// The node has a license other than the site's default
$license = copyright_get_license($node_license->cpyid);
$node->content['copyright'] = array(
'#value' => theme('copyright_footer', copyright_notice($license, $node, $node_license)),
'#weight' => 10,
);
drupal_add_css(drupal_get_path('module', 'copyright') .'/copyright.css');
} // <=== CHANGE
}
break;
----------------------------------------------------------------------

#2

Version:5.x-1.5» master
Status:active» reviewed & tested by the community

I'm not sure this is actually a bug but I'd like to hide the copyright on teasers, too.

adalan's code works perfectly for me, so here's a patch. I'm marking this RTBC.

AttachmentSize
copyright_noteaser_159819.patch 1.97 KB

#3

Version:master» 5.x-1.6
Component:Code» User interface
Category:bug report» feature request
Priority:critical» normal
Status:reviewed & tested by the community» fixed

Some people want to display the license on teasers, some don't, so I've added more display options on 'admin/content/types/story' (for example) that allow you to:
1. display or hide the notice on full node pages,
2. display or hide the notice on teasers,
3. display or hide the notice if it is equal to the site-wide default.

This will be included in the next release of copyright (5.x-1.7).

#4

Status:fixed» closed (fixed)

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

#5

Thanks! I just updated and this is working perfectly.