I installed Tweetbutton and tried to set up the tweet text to be "[node:title] | [site:name]" but now my site is stuck. I can't add any new nodes and can't change my tweetbutton fields. I get an error message: "Tweet text cannot be longer than 32 characters but is currently [x] characters."

Members fund testing for the Drupal project. Drupal Association Learn more


codefever’s picture

I see this problem in my site as well. I've been searching for a fix for a few days. Anyone else run into this?

FAAREIA’s picture

  \sites\all\modules\tweetbutton\tweetbutton.install (1 hits)
	Line 18:           'length' => 32,  
  \sites\all\modules\tweetbutton\tweetbutton.module (1 hits)
	Line 114:     '#maxlength' => 32,

change 32 to 140. it works for me

tokapeb’s picture

Status: Active » Needs review
941 bytes

The patch, based on Stakcreativa's comment is attached, please review. Cheers!

Charles Gantt’s picture

Status: Needs review » Reviewed & tested by the community

I have reviewed the patch and implemented it on 2 sites, which fixed the 32 character max string length. It worked fine on both sites and I have yet to see an issue arise.

mvc’s picture

Status: Reviewed & tested by the community » Needs work

the patch looks fine at first glance but without hook_update_N() the problem will only be fixed for new installations, not for sites already using an older version.

georgemastro’s picture

You can change the values from phpMyAdmin to tables "field_data_field_tweet_basic" and "field_revision_field_tweet_basic" like in the attachment.

wildlife’s picture

I attempted to change the values in phpMyAdmin from 32 to 140, but that had no impact on getting the original error message.

In addition, I'm finding that this problem is preventing us from editing any existing content on our site. When I try to edit page content on pages with titles that are more than 32 characters, this error prevents the saving of any edits. This is a very critical problem that is forcing me to disable the Tweet Button module until it is resolved.

I wish the Drupal 7 version of this module worked the same way as the Drupal 6 version.

dxx’s picture

For the current stable version (7.x-2.0-beta1+1-dev), you can simply fix this issue:

Edit tweetbutton.module file at line 114 replace "'#maxlength' => 32," with "'#maxlength' => 128,"

(field_tweet_button_text database field has VARCHAR(128) by default)

deepak_zyxware’s picture

Issue summary: View changes
10.47 KB

I have changed the maxlength for the form elements to fix this issue.

As install file has been written correctly, no need the patch that file. Update the maxlength for the field 'account' (tweetbutton_field_widget_form) as 32 and 'text' as 128.

This solved my issue.

deepak_zyxware’s picture

I am updating with a minimized patch file.

deepak_zyxware’s picture

Updating again by keeping only relevant patch for this issue.

berenddeboer’s picture

Status: Needs work » Reviewed & tested by the community

Works for me.

deepak_zyxware’s picture

Updating with a patch which path changed.

deepak_zyxware’s picture

Status: Reviewed & tested by the community » Needs review
deepak_zyxware’s picture

Status: Needs review » Active
deepak_zyxware’s picture

Status: Active » Needs review

timmillwood’s picture

Status: Needs review » Fixed
timmillwood’s picture

test please ignore

Status: Fixed » Closed (fixed)

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