Closed (fixed)
Project:
Ridiculously Responsive Social Sharing Buttons
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 Nov 2017 at 14:01 UTC
Updated:
26 Feb 2018 at 10:00 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jurgenhaasThe patch covers both scenarios:
Comment #3
adamps commentedAs a maintainer it is difficult to have code "if XX module is installed...". There are so many other modules and it would be time-consuming for me to test it in future.
As it stands, the code does not seem safe to work in the long term as it is reading another modules config and the dependency on specific ordering of events is a little tricky (e.g. the patch is missing code to undo the change).
I feel that the better fix is if you could raise the issue with extlink to add a scheme for mappings of "other modules" => "exclude CSS classes".
I guess as a fallback I would consider code here following a safer pattern that would never be called if extlink was missing, e.g. if extlink were to add a hook "hook_extlink_class_ignore".
Comment #4
jurgenhaasPerfectly understandable. It's not a must, just a service that rrssb could offer as a convenience to its users. And as extlink is fairly popular with 60+ thousand reported installs I thought it might be worth the effort.
Agreed, but if there was an API from the other module, it would be the same effect to having an eye on it for future changes. Undoing the changes is now supported in the modified patch.
Valid point, fixed in the modified patch. It only acts during install or uninstall of any module anyway, so not during regular operation of the site.
Don't get me wrong, don't want to push any feature on your module, but at least I wanted to improve the patch for the feature request such that it only acts if extlink is available and also reverts the changes when rrssb got uninstalled.
Comment #5
adamps commentedOK so I'll set this as postponed. It's good to have your patch linked here in case it is useful to others.
If you want, you could raise a feature request with extlink to ask for an API to make it easier for other modules to integrate.
Comment #6
jurgenhaasThanks @AdamPS it's exactly my thinking too: let's have the patch available here for folks who were interested. And I also submitted a feature request to Extlink, see #2921077: Introduce an API to alter settings. Let's see what's happening.
Comment #7
jurgenhaasNow that the API is available in extlink I have implemented that alter hook here and the solution is now really very simple.
Comment #8
adamps commentedSomething seems wrong - you hook is given an array and returns a string.
Comment #9
jurgenhaasNo, it IS given a string as well. That string contains a comma separated list of selectors and with the implode I'm just appending another selector. This simple "trick" works with an empty input as well as with a string that already contains values.
Comment #11
adamps commentedAh yes I see, cunning. I added a comment.
Comment #13
philyNo patch needed, just add
.rrssb-buttonsin the CSS Matching exclude list within External Links settings.Comment #14
jurgenhaasWell, that a lazy approach and provides a bad UX. Why should the user be doing this manually if the module can do it because it knows exactly that this is requird? Or do you know of a scenario where both modules are enabled together and where this addition were not required?