Closed (fixed)
Project:
Twitter
Version:
6.x-3.x-dev
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
11 Dec 2011 at 22:52 UTC
Updated:
6 Jun 2012 at 21:31 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
danreb commentedI have this notice too.
Comment #2
danreb commentedChange issue title
Comment #3
graemehunter commentedI have the same issue as danreb in comment #1, doesn't happen on the home page of the site, but that same set of errors appears when I go to an article or node on my test site.
Comment #4
pinguinland commentedExactly the same problem...
Comment #5
dtone commentedI get the exact same notice (as in #1) when I finished setting up the OAuth (7.x-3.0-alpha2) & twitter (7.x-3.0-beta3) modules and then posting an article (which is nevertheless accepted and visible as a feed at my twitteraccount).
Comment #6
zoszabo commentedSame problem ...
Comment #7
steinmb commentedAny of these twitter accounts private?
Comment #8
oenie commentedI traced the problem back to the 'tweets' view of the twitter module.
For some reason, the view is getting called with the node id as the user-id , which, in most test-cases, isn't an existing user.
There's no check whatsoever on whether a user_load with the supposed uid yields a user, with the problems as listed in the OP's message.
Your best solution for now; disable the tweets view (added by the Twitter module) in your views section , and your problem should go away.
Mine did !
I'm looking into why the view is actually getting called, because it has a specific path associated (it could be because of the block)
to be continued
Comment #9
oenie commentedOK, as i suspected, i found the actual reason:
The tweets view, added by the Twitter module, has a block 'User tweets'.
However that block has a contextual filter that takes a UID.
In my opinion, this is not right. It was probably mistakenly added to the Block view, where it should only be on the Page-view.
So you can leave the view enabled, but be sure to either disable the block User Tweets or make sure it is only on pages without extra parameters that might be interpreted as a UID.
I think the block of the tweets view of the twitter module ought to be reviewed.
Comment #10
steinmb commentedAs far as I know is the reason for picking up the uid for the block is to show tweet's from the node author. Not sure why, but this user also reported problems with uid and Views, this time in 6.x-3 #1372312: SQL errors in Views
Comment #11
pinguinland commentedYes it worked for me!
Comment #12
MLSatya commentedYes I am having the same issue, but I would prefer not to disable the block. I need the tweets to come in a block and appear only on the home page.
Comment #13
WildStar commentedAlso having this issue.
danreb #1 who first reported the problem, and oenie #9 who homed in on the issue are spot on!!
Was trying to run tweets module with views ticker with a block display. Until fixed, how does one display with page?
I know it's beta.... but I'm anxious for a fix. :) This is a GREAT Drupal module!
Comment #14
Anonymous (not verified) commentedDisabling the bock did it for me, thanks!
Comment #15
alberto56 commentedAs oenie mentioned in comments 8 and 9, the tweets view assumes that arg(1) is the uid, when it is not necessarily: it can be anything.
For my purposes, I never need to view the tweets of a given user, only the tweets view which ignores the user argument. For me the following patch works
I am including a patch that works for these purposes, but if you want to see individual users' tweets, this might not work for you.
Comment #16
sfsilks63 commentedHi I have the same problem but I have disabled the block and it is still the same
http://www.naked-runner.com/?q=content/almeria-half-marathon
Comment #17
fraweg commentedHi,
For me the same!
The second thing is that the "http://...../user/1/tweets" shows no tweets. But when I save a forum topic it is shown in my "normal" twitter account under "https://twitter.com/#!/User"
This solved the second issue!But the first still alive!
Can anyone help me?
Thanks in advanced!
Frank
Comment #18
webatelier commentedFollow this howto and it should be fine
http://drupal.org/node/1253026
especially this part is important :
Expand the "Advanced" link (in Drupal 6, it is called "Arguments") at the right and remove the contextual filter by clicking on it and hitting "Remove".
worked for me after initially having the same problem
Comment #19
damien_vancouver commentedHello all,
I just wanted to clarify why this is happening and provide the best instructions I was able to find.
By default, the Twitter module creates a block using Views, that is intended to be displayed on User pages only. So, the reason you are seeing errors is that when you enable that block site-wide, it can't figure out which user it's supposed to display for... because it gets that user ID by expecting you are viewing a user's account page, ie. http://example.com/user/123 would look up the tweets for uid 123. So you get those PHP errors if you are at a path that doesn't have a uid as the second element.
The solution is to create a new clone of the "User Tweets" block, that is set up to display tweets from a single, fixed User ID. Then it will work on any page!
So, if you want a global block of twitter feeds from a single user, here is what to do.
Now you should be able to use the Global tweets block site-wide, but you can still use the User Tweets block and page for individual users.
To change which user is the global tweet user, edit the User:Uid contextual argument you set above and change the fixed value to be the new user id.
To make the global tweets block show ALL tweets from ALL users on the site, you can just remove the Contextual User:uid filter altogether. Edit the view, click the filter, and hit "remove" next to it. (remember to make sure you've chosen "This block only (override)"!!).
Other sources of these instructions are: #574556: Global account's tweets don't appear and http://drupal.org/node/1253026. If you're still confused, try reading those too!
I'm changing this issue status to be a documentation issue, as it's not actually a bug. What we are missing is clear instructions in the module's README.txt on how to accomplish this. I will work on a patch for that and post it on here.
Comment #20
johnpicozziI was having the same issue and I didn't want to disable the block. I removed the UID from the contextual filters section and the problem seems to have gone away. Not a fix but a way around the error if you need tweets and don't care about specific users. Another note, I am using one "Global" Twitter account.
Comment #21
scthomps312 commentedI had to add another step to #19 to get this to work. When doing this action...
...you still have to deal with the case where an argument is available, because the first step in the Twitter PHP is to get arg(1), which the code assumes is a user ID. My fix was to comment that out and set $uid to 7, same as the Fixed Value I set in #19's instructions.
//$uid = arg(1);
$uid = 7;
See the attached screenshot. I also commented out the if/else, as it becomes unnecessary.
I'm using a global Twitter account where the block is displayed several places on the site, which I mention because it's critical to the use case.
Comment #22
Donovan commentedI kept getting an "Ajax" error with every attempt to change uid to admin uid. In the process I noticed that the "User Tweets" block was enabled in addition to the cloned "Global Tweets" block, so I disabled the "User Tweets" block ... and Presto! problem solved!!
Comment #23
juampynr commentedRemoved inherited contextual filter uid from Views Block display.
http://drupalcode.org/project/twitter.git/commitdiff/f4e985b
Porting now to the Drupal 6 version.
Comment #24
juampynr commentedBackported to Drupal 6.
http://drupalcode.org/project/twitter.git/commitdiff/b1aa51c
Thanks everyone for the support and info given!
Comment #26
juampynr commentedChanging title.