I've noticed two potential problems with the friendfeed_menu function. I think there are a couple of checks that should be performed to determine if the FriendFeed tab should be visible.
First, user_access('view friendfeeds') is not checked by this function, or anywhere else in the module, even though the permission is settable. It's my guess that this permission setting would not be relevant for the block view, since blocks have their own permission management, but I'd expect it to be in effect here.
Secondly, I would think that this tab should only be displayed if the FriendFeed username and API key are set for the user. (Or alternately, the tab would display a message that these parameters aren't set, rather than generating an error message, which is the current behavior.)
Micah
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | friendfeed.module.txt | 9.41 KB | dugh |
| #7 | friendfeed.module.txt | 9.37 KB | dugh |
| #6 | friendfeed.module.txt | 9.35 KB | dugh |
| #2 | friendfeed.277826.patch | 619 bytes | micahw156 |
Comments
Comment #1
robloachAh, again the Drupal 5 menu system....
As for the second point... Good idea.... I'll switch this issue to reference that.
Comment #2
micahw156Not sure if this is the best approach or not. I looked at the way the existing code works, and it seems silly to put the code to check for this before calling the tab, especially in light of the changes being made via #274763: Error retrieving feed from FriendFeed.
Instead, I wrapped the call with a simple check that displays a message when the user's FriendFeed configuration is incomplete. I'm totally open to better verbiage here. Here's a simple patch that implements this check. Let me know what you think.
Micah
Comment #3
robertjwhitney commentedSo should I patch this into the friendfeed module to try it? Or somewhere else.
Comment #4
micahw156@robertjwhitney Yes, this patch is an update to friendfeed.module.
Comment #5
robloachWhat if we stuck the check right in the function itself and then did this instead?
Comment #6
dugh commentedThis appears to work for me, it hides the FriendFeed menu item from view if there is no FriendFeed stuff configured:
Here also is a little addition to put the FriendFeed configuration form in its own category when you edit your profile:
And lastly here is a change to add the FriendFeed badge at the top of the feeds list so that people can subscribe to you:
In function friendfeed_user_view I changed:
and my function theme_friendfeed_user_feed starts out like so:
I attached my whole friendfeed.module file.
It's working on our department site, see for example http://itls.usu.edu/people/doug-holton
Thanks for this module by the way. The activitystream module really had serious problems that were too much for me to try to fix myself.
Comment #7
dugh commentedHere's the file with a parenthesis restored (I was making other minor changes too that weren't important).
And also I added a check_plain for security: check_plain($username)
Comment #8
dugh commentedAll of the above changes still work in drupal 6, too, except for the first one to hide the menu tab if the person hasn't entered friendfeed info.
I tried making a drupal 6 version but it's not working yet. I thought I'd go ahead and post what I have in case one of you knows the problem.
I based it on the _contact_user_tab_access %user menu tab example near the bottom of this page:
http://drupal.org/node/209056
and here http://api.drupal.org/api/function/_contact_user_tab_access/6
Do I need to change the 'access arguments' for example, or what.
Comment #9
dugh commentedI guess I just needed to clear my cache, it's working now. The tab is hidden if the user has no friendfeed info.
Comment #10
micahw156Drupal 5 has reached end of life, so I am closing all D5 issues in my list. If this issue still applies with Version 6.x or later, please reopen this issue with correct version tag.