为什么除了超级管理员用户之外的任何人的视图中都不会显示标志链接

发布于 2024-09-30 08:57:55 字数 815 浏览 3 评论 0原文

我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

装迷糊 2024-10-07 08:57:55

据我所知,标志只有有权与其交互的用户才可见。至于标记链接的放置,可以通过两种方式完成:

  1. 手动调用 flag_create_link() - 请参阅 帮助页面
  2. 自动按标志,在标志的管理页面中设置“在评论下显示链接”。在这种情况下,它会在变量 $links 中打印出其他链接。flag

模块的 2.0 beta 版本也有一些惊人的改进 - 您尝试过吗?肯定会推荐它,尽管它说是测试版,但我已经在生产中使用它有一段时间了,而且管理 UI 更加干净。标志 2.0 beta 3 访问权限部分的屏幕截图,可能有用

alt text

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文