views:

19

answers:

1

I have a node type on my Drupal site that uses a Flag to let users "unpublish" or "publish" their content. This is not the same as Drupal's node publishing... that is still reserved for admins of the site. Instead, the Flag is used to determine if the node shows up in other Views. I've also created an "admin" type page for each user to allow them to manage their nodes and determine which ones should be published using this Flag. This page has two views, one of flagged nodes and one of unflagged nodes. That way they can either "publish" or "unpublish" their content from a central location.

My problem is that on this page, the Flag links don't show up for the user. The FLag is respected in the two views (one for flagged and one for unflagged) but the links to flag or unflag content don't show up. They're only visible if logged in as the super admin account for the site.

The Flag is set up as a global flag and enabled for the specific content types the users can control. If I check the "display link on node page" or the "display checkbox on node edit form" the link is displayed in those places, but still not in the views on the "admin" page. Both Views and Flags modules are up to date (though some other modules are not, but I don't think that would cause this).

Does anyone know what might be causing this behavior? Or could someone suggest a way to debug this to figure out what's going wrong?

------------------------- Update ------------------------

There's been quite a bit of discussion with wiifm (thanks by the way) but something absolutely ridiculous just happened... for the Flag in question, I removed all of the roles from the flag, so under "Roles" that are allowed to use this flag absolutely nothing is selected. On the Flag admin page, it says that "No roles" are allowed to use it... and this fixed the issue. The flag links now show up in the Views where they are supposed to. They still show up on the node edit form as well. This just boggles my mind. It shouldn't be working at all, yet its finally working correctly. I really don't know what to make of this.

A: 

From what I know about flags, is that they are only visible to users that have permission to interact with them. As for the placement of the flag link, it can be done in two ways:

  1. Manually with a call to flag_create_link() - see the help page
  2. Automatically by flag, be setting 'Display link under comment' in the administration page for the flag. In this case it gets prints with other links in the variable $links

There has been some amazing improvements in the 2.0 beta version of the flag module as well - have you tried this? Would definitely recommend it, even though it says beta, I have been using it in production for some time now, and the admin UI is much cleaner. Screenshot of flag 2.0 beta 3 access permissions section, which maybe of some use

alt text

wiifm
You can also display flag links using Views (Flags has pretty good integration with Views), which is how I'm doing it now. But for some reason Views isn't adding the link for anyone but the "super admin" account, which makes me think this is permissions related. The only option in the "Permissions" page if for "Administer Flags". When creating the flag you can set which roles have access, which is currently set to "authenticated user". I'd really prefer not to use a beta version of Flags, but maybe I'll check it out.
Chaulky
I would highly recommend the beta, purely because it gives you the granularity you require on access to the flags. Give it a go and let me know
wiifm