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.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | better_social_sharing_buttons-3575252-fix-decorates-per-node-feature-service-6-5.x-48.patch | 1.05 KB | dpiet |
Issue fork better_social_sharing_buttons-3575252
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
Comment #3
dpiet commentedComment #4
divya.sejekan commentedVerified 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
Comment #5
dpiet commented@divya.sejekan, thank you for the review.
Comment #6
dpiet commentedHere is a patch to fix " per node feature service " for 5.x version.
Comment #7
mably commentedPatch applied successfully. I can confirm that it fixes the problem.
Comment #8
edgar saumell commentedI confirm this patch works flawlessly on beta3!
Comment #9
dpiet commented@edgar_saumell and @mably, thank you for the review.
Comment #11
shelaneComment #13
dpiet commentedThanks for the merge and the credit @shelane.