Hi there, I'm experiencing some problems since I have upgraded to the latest dev version, if I go to any user/xxxxx/edit page I got a Notice and a Warning messages:
Notice: Undefined index: field en twitter_post_field_attach_form() (line 146 at .../sites/all/modules/twitter/twitter_post/twitter_post.field.inc).
Warning: Invalid argument supplied for foreach() en twitter_post_field_attach_form() (line 146 at .../sites/all/modules/twitter/twitter_post/twitter_post.field.inc).
Then when I publish a content that should generate a tweet (that doesn't generates) I got this other messages:
Notice: Undefined index: es en twitter_post_entity_insert() (line 35 de .../sites/all/modules/twitter/twitter_post/twitter_post.module).
Warning: Invalid argument supplied for foreach() en twitter_post_entity_insert() (línea 35 at .../sites/all/modules/twitter/twitter_post/twitter_post.module).
Notice: unserialize(): Error at offset 0 of 1 bytes en UserController->attachLoad() (line 307 at .../modules/user/user.module).
Notice that at the last Notice message the path goes straight to "modules/" instead of "sites/all/modules/", I don't know if this have any implication, but anyway I call your attention on it.
I tried to uninstall the tweeter module I was just able to uninstall the "Twitter acctions" and "Twitter signin" submodules, but dealing with "Twitter post" one was impossible because even though I eliminate the twitter post field of the content I'm willing to tweet, the "Twitter post" submodule continues saying there was a field implicated.
Any way I tried again to unnistall the module and this time I succeded, why?... nfi. Well, I not only desable it but uninstall it also, then I reinstall it, but the behaviour is the same.
Any idea of what could be happening, I would appreaciate very much your help.
thanks
Comments
Comment #1
Cray Flatline commentedI have completely same problem. I have non-english website without internationalization. Such problem happens because a wrong language used in the fields. My node have language code 'ru', and twitter field has code 'und'.
I'm not a developer, so I can't create solution, but may be my investigation help somebody.
When I changed row 35 in the twitter_post.module to
foreach ($entity->{$field_name}[LANGUAGE_NONE] as $delta => $field_instance) {
and in the row 137 of the twitter_post.field.inc hardcoded $langcode = LANGUAGE_NONE;
module started post to twitter.
Comment #2
andrés chandía commentedYes, I made the changed you suggested and posting on twitter was working again, eventhough the warnings at users edit pages remain.
The site with this problem is as yours not multilingual, only spanish, I have another multilingual site where this does not happens.
Thanks for sharing your fix.
Comment #3
symphonia commentedThank you, this worked for me too. I have another question: how can I display tweets in a block? I've tried with views, but no tweets are displaying :(
can you help me please?
Comment #4
andrés chandía commented1.- Create a block in your drupal
2.- Go to your twitter account > configuration > Widgets > Create New > Create widget.
At the box below will appear a code, copy it.
3. Paste the code in the body of your brand new block.
4. Save and enable the block.
and voilà, you have a block with tweets of your account.
enjoy it!!
Comment #5
symphonia commentedThank you, but it doesn't work. The block displays just the code as I wrote it, despite I set the Full HTML ...
I'll try with twitter pull module to see if I can display tweets.
With Twitter module I can only post to twitter from my site, but I can't display any tweet, also on the view page /tweets provided with that module...don't know why, it's a bug for sure but I am not able to fix it...
Comment #6
andrés chandía commentedIf you have any code editor (WYSIWYG) module like CKEditor or other you have to turn into plain text mode before pasting the code.....
Comment #7
symphonia commentedI've done it, but it didn't work...
Comment #8
andrés chandía commentedmine: http://parles.upf.edu/node/1011 (as an example)
Comment #9
symphonia commentedFinally I can display twitter posts: I installed the Twitter Pull module!! Works perfectly!
Comment #10
sergeypavlenko commentedFixed two bugs. Displays error on the page user/xxxxx/edit and error before publication.
Comment #11
sergeypavlenko commentedReview patch
Comment #12
andrés chandía commentedI have updated to twitter-7.x-6.x-dev, it didn't post to tweetter
and it shows me these messeges:
then I applied the patch:
but it does not work, I get same messeges and it does not post to tweetter:
Then I tried the changes proposed in comment #1 posted by CryAngel and I could post to twitter, and no messeges were shown.
Comment #13
maen commentedThe same as http://drupal.org/node/1953270#comment-7342770 here. Although I can't take the solution because the entity fields crashed...
Comment #14
liquidcms commentedsimilar error on forms which do not have standard fields (and do not need to post to twitter):
attached patch fixes the error
Comment #14.0
liquidcms commentedAdding some more information
Comment #15
symphonia commentedHello! I've just installed the dev version 2 of twitter module. No error shown but no tweets! I have same module installed on other sites but here it just doesn't works! Anyone can help please? thanks
Comment #16
damienmckennaTriggering the testbot.
Comment #17
damienmckennaTriggering the testbot.
Comment #18
jessehsThis patch also checks to see if the $form_state['field'] isset().
Comment #21
damienmckennaComment #22
damienmckennaClosed a duplicate: #2469449: Invalid argument supplied for foreach() twitter_post.module:35
Comment #23
damienmckennaIt should also be using field_get_items() to load the correct language value, not hardcoding it.
Comment #24
damienmckennaThis should have been fixed by #2139117: Warnings when editing entities without fields.