Copyright being shown in the teaser

manuj_78 - July 16, 2007 - 19:26
Project:Copyright
Version:5.x-1.6
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

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.

#1

ericbellot - December 23, 2007 - 01:10

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

Christefano - January 14, 2008 - 12:39
Version:5.x-1.5» HEAD
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

Robrecht Jacques - August 9, 2008 - 07:32
Version:HEAD» 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

Anonymous (not verified) - August 23, 2008 - 07:35
Status:fixed» closed

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

#5

christefano - August 23, 2008 - 14:16

Thanks! I just updated and this is working perfectly.

 
 

Drupal is a registered trademark of Dries Buytaert.