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.
Comments
Comment #2
kenwest commentedComment #3
damienmckennaA patch.
Comment #4
damienmckennaCommitted. Thanks!