为什么除了超级管理员用户之外的任何人的视图中都不会显示标志链接
我的 Drupal 站点上有一个节点类型,它使用 Flag 来让用户“取消发布”或“发布”其内容。这与 Drupal 的节点发布不同...它仍然保留给站点管理员使用。相反,标志用于确定节点是否显示在其他视图中。我还为每个用户创建了一个“管理”类型页面,以允许他们管理其节点并确定应使用此标志发布哪些节点。该页面有两个视图,一种是标记节点,一种是未标记节点。这样他们就可以从一个中心位置“发布”或“取消发布”他们的内容。
我的问题是,在此页面上,标记链接不会向用户显示。 FLag 在两种视图中受到尊重(一种用于标记,另一种用于未标记),但标记或取消标记内容的链接不会显示。仅当以网站的超级管理员帐户登录时,它们才可见。
该标志被设置为全局标志,并针对用户可以控制的特定内容类型启用。如果我选中“在节点页面上显示链接”或“在节点编辑表单上显示复选框”,链接将显示在这些位置,但仍然不会显示在“管理”页面的视图中。 Views 和 Flags 模块都是最新的(虽然其他一些模块不是,但我不认为这会导致这种情况)。
有谁知道可能导致这种行为的原因是什么?或者有人可以建议一种调试方法以找出问题所在?
- - - - - - - - - - - - - 更新 - - - - - - - - - - - -
与 wiifm 进行了相当多的讨论(顺便感谢),但发生了一些绝对荒谬的事情......对于有问题的标志,我从标志中删除了所有角色,因此在允许使用的“角色”下该标志绝对没有被选择。在标志管理页面上,它说“没有角色”可以使用它......这解决了问题。标志链接现在显示在视图中应有的位置。它们仍然显示在节点编辑表单上。这让我很困惑。它根本不应该工作,但它最终工作正常。我真的不知道该怎么办。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,标志只有有权与其交互的用户才可见。至于标记链接的放置,可以通过两种方式完成:
$links
中打印出其他链接。flag模块的 2.0 beta 版本也有一些惊人的改进 - 您尝试过吗?肯定会推荐它,尽管它说是测试版,但我已经在生产中使用它有一段时间了,而且管理 UI 更加干净。标志 2.0 beta 3 访问权限部分的屏幕截图,可能有用
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:
$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