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.
The og_views module is currently forcing a feed onto the group homepage regardless of whether the group's homepage view actually has a feed display or not.
In the function "og_views_view_group" would it be possible to put a little check to see if the view has a feed or not, and then only call drupal_add_feed if it does?
Comment | File | Size | Author |
---|---|---|---|
#9 | 755904-9-impossible-remove-feed.patch | 474 bytes | rahulbile |
#7 | og.755904-7.patch | 1.89 KB | Grayside |
#6 | og.755904-6.patch | 1.32 KB | Grayside |
#2 | 755904-og-views-remove-feed.patch | 613 bytes | mrfelton |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedWhy is this drupal_add_feed necessary in the first instance? If you 'attach' a Feed display to the Default display of an og_ghp view won't the feed icon be displayed by Views RSS plugin anyway?
For example, I have a custom view og_ghp_mysite with two displays "Default" and "Feed". In the "Feed" display under "Feed Settings" I "Attach to ..." Default display. Views modules then adds a Feed icon link to the Default display. I then get two feed icons, one fixed by OG and one dynamically generated by Views.
It seems to me the fixed feed icon generated by OGs drupal_add_feed is unnecessary, rather the default view og.og_ghp_ron.view should be altered to attach the 'Feed' to the 'Default' display at the start i.e. delete drupal_add_feed from og_views_view_group, and modify default view og.og_ghp_ron.view feed setting (line 132 ish) from:
$handler->override_option('displays', array(
'default' => 0,
));
to
$handler->override_option('displays', array(
'default' => 'default',
));
and then let Views RSS plugin add the feed icon.
I've commented out the drupal_add_feed function in my install of og_views.module line 219, and I can attach feeds to the default display of OG home page using Views just fine. I'm using OG 6.x-2.0 and Views 6.x-2.8.
Comment #2
mrfelton CreditAttribution: mrfelton commentedI agree. Basic atch attached.
Comment #3
thePanz CreditAttribution: thePanz commentedTested, working fine!
Don't replicate (and hard code) a feature that can be provided using other modules (Views in this case) :)
Thank you mrfelton
Comment #4
pcarman CreditAttribution: pcarman commentedduplicate post
Comment #5
pcarman CreditAttribution: pcarman commentedNot sure why the patch gave me some trouble, but the solution is good. We have been searching for a way to remove the RSS feed and this worked. I agree this feature should just be left up to views and not hard coded into this module.
Comment #6
Grayside CreditAttribution: Grayside commentedI checked the patch, and while it failed to apply cleanly manually dropping the line was easy enough.
Unfortunately this patch does not update the existing og_ghp_ron view to attach the RSS Feed to the Default display so Views actually does handle the RSS feed icon. Attached patch adds that in to preserve consistency.
If someone else could just confirm all's well and set to RTBC I will commit.
Comment #7
Grayside CreditAttribution: Grayside commentedLooked a little longer, realized there was a now retired hook_menu entry implied in going to a proper use of Views to attach the RSS feed. However, we now have another problem--by skipping hook_menu() and it's very nice ability to enforce node_view() permission to see the RSS feed, the feed is now "unrestricted" access. This is not tenable.
That makes this issue postponed on #1429016: OG Access integration with OG Views, though as an alternative hook_menu_alter() could be used to adjust access to the RSS feed in this case, that's a very lonely workaround.
Comment #8
madmanmax CreditAttribution: madmanmax commentedMarked #659476: Disable feed as duplicate of this issue.
Comment #9
rahulbile CreditAttribution: rahulbile commentedPatch against 2.4.