Problem/Motivation

The better_social_sharing_buttons_per_node sub-module no longer overrides the parent service. When the sub-module is enabled and "Enable Social Sharing Buttons" is unchecked for a given content type via /admin/structure/types/manage/{type}, the sharing buttons are still displayed.

This is because the service better_social_sharing_buttons.service was renamed to better_social_sharing_buttons_per_node.service in better_social_sharing_buttons_per_node.services.yml, but the decorates key was not added. As a result, the parent module keeps using its own service and the per-node settings are completely ignored.

Steps to reproduce

1. Enable better_social_sharing_buttons and better_social_sharing_buttons_per_node
2. Go to /admin/structure/types/manage/article
3. Uncheck "Enable Social Sharing Buttons"
4. View an Article node
5. Expected: No sharing buttons displayed
6. Actual: Sharing buttons are still displayed

Proposed resolution

Add the decorates key to the service definition in better_social_sharing_buttons_per_node.services.yml.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dpiet created an issue. See original summary.

dpiet’s picture

Status: Active » Needs review
divya.sejekan’s picture

Verified the PR. After disabling the Enable Social Sharing Buttons in /admin/structure/types/manage/article , the share icons are getting disabled in article node
RTBC ++

Steps to reproduce
1. Enable better_social_sharing_buttons and better_social_sharing_buttons_per_node
2. Go to /admin/structure/types/manage/article
3. Uncheck "Enable Social Sharing Buttons"
4. View an Article node

dpiet’s picture

@divya.sejekan, thank you for the review.

dpiet’s picture

Here is a patch to fix " per node feature service " for 5.x version.

mably’s picture

Status: Needs review » Reviewed & tested by the community

Patch applied successfully. I can confirm that it fixes the problem.

edgar saumell’s picture

Version: 5.0.0-beta2 » 5.0.0-beta3

I confirm this patch works flawlessly on beta3!

dpiet’s picture

@edgar_saumell and @mably, thank you for the review.

  • shelane committed afd601d1 on 5.x authored by dpiet
    fix: #3575252 Adding decorates property to fix per-node feature
    
    By:...
shelane’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

dpiet’s picture

Thanks for the merge and the credit @shelane.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.