Posted by yaworsk on June 12, 2011 at 5:20pm
7 followers
| Project: | Tweet Button |
| Version: | 7.x-1.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Hi all,
installed the tweetbutton module and configured it for 2 out of 10 content types on the admin config page but noticed the button was showing on all content types. Made a small change to line 83 in the tweetbutton.module to make the in_array function call strict:
if (in_array($node->type, variable_get('tweetbutton_node_types', array('article')), TRUE)
it was so minor that I didn't create a patch but can if needed.
Pete
Comments
#1
subscribing :)
#2
Subscribing.
I can confirm I had the same issue with Tweebutton ignoring my node type selections, and this fix works for me.
Ent.
#3
Had the same problem. Rolled patch from yaworsk's post
#4
On the assumption that this minor patch has effectively been tested, changed to RTBC... Please commit
#5
It appears it was committed three days after 7.x-1.1 was released?
http://drupalcode.org/project/tweetbutton.git/blobdiff/c7755007ec35849e0...
It also appears that 7.x-2.0 doesn't have this issue. It was tagged in January but no release node made?
#6
Thanks for this. Pete's solution worked for me too.
However, I also had an issue with the Tweet Button appearing in both the Full view and the Teaser view regardless of how it was configured to appear. To resolve this, I just needed to change the line below the one described above in a similar manner.
Here are the two lines:
if (in_array($node->type, variable_get('tweetbutton_node_types', array('article')), TRUE)
&& in_array($view_mode, variable_get('tweetbutton_node_location', array('full')), TRUE)
#7
I also got the same problem and you can also update these line in twitter.admin.inc
line no. 104
code before :
$node_types = node_type_get_types();
foreach($node_types as $node_type) {
$types[$node_type->type] = $node_type->name;
}
this code doesn't make any sense we can just call this function to get node type name : node_type_get_names()
$form['tweetbutton_node_types'] = array(
'#type' => 'checkboxes',
'#title' => t('Node Types'),
'#options' => node_type_get_names(),
'#default_value' => variable_get('tweetbutton_node_types', array('article')),
);
#8