Active
Project:
Links Package
Version:
6.x-1.2
Component:
Code: links_related.module
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Dec 2009 at 22:03 UTC
Updated:
12 Dec 2009 at 14:46 UTC
hi ,
links_related is a great module, especially embedded links !
but , for example, if i choose to disable related links for the built-in content type "page" : page nodes will nevertheless show related links :\
thx you in advance for bug fix
Comments
Comment #1
jahjah92 commentedany suggestion ?
however it's a problem when you use "page" content type for no-editorial node usage .
Perharps there is already an issue for this problem, so please tell me
Comment #2
jahjah92 commentedokay , i found a solution :
it was a bug induced by another fix issue "Links from Article Text don't show if no related links" ( http://drupal.org/node/627832 )
must check if link related is authorized for the current content type before view preprocess
to do so I check variable_get('links_related_types_'. $node->type, 0);
here is the fixed function fir the 2 issues
I hope it will help someone
/**
* Prepares a view of the links depending on the node viewing mode
* and the links_related module settings.
*/
function _links_related_prep_view(&$node, $teaser=FALSE, $page=FALSE) {
if ($teaser) {
return '';
}
// recupere la variable pour savoir si le type de node accepte les liens
$do_links = variable_get('links_related_types_'. $node->type, 0);
if ( $do_links ) {
$do_related = variable_get('links_related_enable_list',TRUE);
$do_embed = variable_get('links_related_enable_embed_list',TRUE);
//if ($do_related || $do_embed) {
$links =& links_load_links_for_node($node->nid, 'links_related');
/* ce bloc bloquait les liens embeded s'il n'y avait pas de liens relatifs
if (! count($links)) {
return '';
}
*/
$html = '';
if ($do_related) {
$list = _links_related_list($node, TRUE, FALSE, TRUE);
$html .= _links_related_format_list($list, t('Related Links'));
}
if ($do_embed) {
$html .= _links_related_embedded($node, FALSE);
}
}
return $html;
}