When attempting to edit a node containing a Twitter Post field, it failed with the following error ...

Recoverable fatal error: Object of class stdClass could not be converted to string in form_select_options() (line 2847 of /var/www/drupal/includes/form.inc).

It occurred in the case where the user had 2 options for Twitter Accounts to which to post. The following patch solved the issue for me ...

--- twitter/twitter_post/twitter_post.field.inc	2015-09-04 19:11:28.000000000 +1000
+++ twitter/twitter_post/twitter_post.field.inc	2015-10-05 14:53:57.000000000 +1100
@@ -149,7 +149,7 @@
           '#title' => t('Twitter Account'),
           '#options' => $options,
           '#id' => 'twitter-account',
-          '#default_value' => $account,
+          '#default_value' => $twitter_uid,
           '#states' => array(
             'visible' => array(
               'input#twitter-toggle' => array(

$account was the StdClass object that caused the failure, and $twitter_uid is the value used in the only-one-option case.

CommentFileSizeAuthor
#3 twitter-n2580185-3.patch619 bytesdamienmckenna

Comments

kenwest created an issue. See original summary.

kenwest’s picture

Issue summary: View changes
damienmckenna’s picture

Status: Active » Needs review
Parent issue: » #2572749: Plan for Twitter v7.x-6.2 release
StatusFileSize
new619 bytes

A patch.

damienmckenna’s picture

Status: Needs review » Fixed

Committed. Thanks!

  • DamienMcKenna committed 38f98e2 on 7.x-6.x authored by kenwest
    Issue #2580185 by kenwest, DamienMcKenna: Twitter Post form didn't load...

Status: Fixed » Closed (fixed)

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