Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
if a node access module is enabled (e.g Organic Groups) several nodes are not accessible to public. Please disable showing service links on private OG pages.
Comment | File | Size | Author |
---|---|---|---|
#3 | service_links-hide-for-private-content-1594682-3.patch | 1.41 KB | chiebert |
Comments
Comment #1
gemalmI did the following and it works. In the option "Show Service Links on specific pages", I have selected the option "show if the following PHP code returns TRUE" and I add the following code:
Comment #2
TheCrow CreditAttribution: TheCrow commentedThanks @gemalm, added also here: http://servicelinks.altervista.org/?q=about/troubleshooting
Comment #3
chiebert CreditAttribution: chiebert commentedI'm coming here from #2009828: Add option to hide for pages that are not normally visible to anonymous users, where my original issue was also caused by the need to hide service links on private Organic Groups content in the 7.x branch. The PHP filter snippet approach in #1 is a bit problematic, especially for OG in D7:
Instead, I suggest we use the Drupal-version-specific version of node_access(), with a user-configurable switch on the admin settings form analogous to the 'hide for unpublished content' check. The attached patch for 7.x-2.x adds this setting in service_links.admin.inc:
... and then adds a check in function service_links_show(), in service_links.module:
This is working well for me, but would need to be backported to 6.x.
Comment #4
Simon Georges CreditAttribution: Simon Georges commentedMoving to "Feature request".
Comment #5
Simon Georges CreditAttribution: Simon Georges commentedDue do the diversity of Drupal modules, it's kinda impossible to evaluate whether the node is public or not (since you can have temporary public node, special codes, GET parameters, ...), so I don't see how this can be build into the module.