Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've created a patch that fixes import and views handler bugs.
Comment | File | Size | Author |
---|---|---|---|
#1 | twitter-fix_import_and_views_handler-1973470-1.patch | 1.27 KB | xopoc |
Comments
Comment #1
xopoc CreditAttribution: xopoc commentedComment #2
symphonia CreditAttribution: symphonia commentedHello... can you tell me how to apply the patch please?
Comment #3
xopoc CreditAttribution: xopoc commentedPlease, read http://drupal.org/patch/apply
This patch is very simple you can apply the patch manually.
-(minus) you should delete string
+(plus) you should add string
Comment #4
juampynr CreditAttribution: juampynr commented@xopoc, could you explain what does this patch fix?
Comment #5
xopoc CreditAttribution: xopoc commented@juampy
Yes, of course.
I added property "is_new" to $twitter_status object. Tweets are not imported without this property.
see twitter.inc
+ $twitter_status->is_new = entity_load_single('twitter_status', $twitter_status->twitter_id) ? FALSE : TRUE;
Variable $status is not defined. There should be $twitter_status instead. Unfortuntelly function entity_load_single('twitter_account', $twitter_status->screen_name) returns FALSE, that why I use entity_load().
see twitter_views_field_handlers.inc
- $twitter_account = entity_load_single('twitter_account', $status->screen_name);
-
+ $twitter_account = entity_load('twitter_account', FALSE, array('screen_name' => $twitter_status->screen_name));
+ $twitter_account = reset($twitter_account);
Comment #6
juampynr CreditAttribution: juampynr commentedCommitted the Views patch. The other fix has been rewritten so twitter_account_save() is used.
http://drupalcode.org/project/twitter.git/commit/65cbf41
Thanks!
Comment #7
sco_tt CreditAttribution: sco_tt commentedI've applied this patch to Twitter-7.x-6.x-dev and I'm able to import tweets but get the following error
I also tried cloning the latest commit via
git clone --branch 7.x-6.x http://git.drupal.org/project/twitter.git
but I'm getting the same error
Comment #8
juampynr CreditAttribution: juampynr commented@sco_tt, your bug has been fixed in #1944174: Error with Web Intents field. The latest dev release contains the fix and this alpha release should be available within a few minutes: http://drupal.org/node/1977486
Comment #9
sco_tt CreditAttribution: sco_tt commented@juampy I'm on the alpha release. Now the first page of the view comes up without any errors (/tweets), however, if I use a page and go to tweets?page=1, the same error message shows up.
Comment #10
juampynr CreditAttribution: juampynr commentedYou mean alpha2? alpha1 has those bugs.
It can also be that the view was modified. Try to revert it to defaults.
By the way. It may be better to create a new issue for this instead of discussing it in a different ticket that is already fixed.
Comment #12
dndood CreditAttribution: dndood commentedHello,
I assume I am having the same problem as others above. I have tried every version of this module (recommended, other and every dev version). The module performs just fine, but on the page for viewing the tweets I get the following errors:
Notice: Trying to get property of non-object in twitter_views_handler_field_formatted_tweet->render() (line 146 of sites/all/modules/twitter/twitter_views_field_handlers.inc).
Notice: Undefined property: stdClass::$text in twitter_views_handler_field_formatted_tweet->render() (line 157 of sites/all/modules/twitter/twitter_views_field_handlers.inc).
Notice: Trying to get property of non-object in include() (line 10 of sites/all/modules/twitter/tweet.tpl.php).
Notice: Trying to get property of non-object in include() (line 10 of sites/all/modules/twitter/tweet.tpl.php).
Notice: Trying to get property of non-object in include() (line 11 of sites/all/modules/twitter/tweet.tpl.php).
Notice: Trying to get property of non-object in include() (line 12 of sites/all/modules/twitter/tweet.tpl.php).
Notice: Trying to get property of non-object in include() (line 21 of sites/all/modules/twitter/tweet.tpl.php).
Notice: Trying to get property of non-object in include() (line 21 of sites/all/modules/twitter/tweet.tpl.php).
Notice: Trying to get property of non-object in include() (line 25 of sites/all/modules/twitter/tweet.tpl.php).
Notice: Trying to get property of non-object in include() (line 25 of sites/all/modules/twitter/tweet.tpl.php).
Notice: Undefined property: stdClass::$twitter_id in include() (line 35 of sites/all/modules/twitter/tweet.tpl.php).
Notice: Undefined property: stdClass::$twitter_id in include() (line 38 of sites/all/modules/twitter/tweet.tpl.php).
Notice: Undefined property: stdClass::$twitter_id in include() (line 41 of sites/all/modules/twitter/tweet.tpl.php).
The thread above looks like the same problem and it is mentioned that it was fixed in the alpha2, but that is not working for me.
Any suggestions would be most appreciated.
Comment #13
mrfreshly CreditAttribution: mrfreshly commentedSolved the mystery here: https://drupal.org/node/2055951