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.
Problem/Motivation
Some projects might not require to use Rules because it is an overkill for this their scopes, but this module require rules.
Rules is not necessary at all since a external module can still do something like:
// Send a tweet.
$twitterPost = \Drupal::service('plugin.network.manager')->createInstance('social_post_twitter');
$twitterEntity = \Drupal::entityTypeManager()->getStorage('social_post_twitter_user');
$accounts = $twitterEntity->loadByProperties([
'uid' => 1,
]);
foreach ($accounts as $account) {
$twitterPost->doPost($account->getAccessToken(), $account->getAccessTokenSecret(), "my tweet");
}
Proposed resolution
Remove Rules as a dependency for the module and make it recommended in documentation.
Remaining tasks
Remove dependency
Update project page
Update documentation
Comment | File | Size | Author |
---|---|---|---|
#2 | 2858275-remove-rules.patch | 259 bytes | gnuget |
Comments
Comment #2
gnugetPatch attached.
Comment #3
gvsoFirst, I agree that you can use this module without Rules, but to allow the module to react on more events (without writing any code) Rules was added as a dependency.
Yeah, we can just make it optional and recommended. However, last time I checked if you declare a Rule Action or Condition and do not enable Rules, pages which are related to Drupal plugins threw an error.
Can you please uninstall the Social Post Twitter and Rules, remove the dependency in Social Post Twitter, install only Social Post Twitter, go to a page like /admin/structure/block, and report if you didn't get any errors?
Comment #4
gnugetI just tried this and all seems to be working as expected.
also, I created #2858267: Unused hybridauth which remove an unused dependency.
Thanks!
Comment #5
gvsoComment #7
gvsoThanks! Patch was committed. We need to update the documentation and project page.
Comment #8
gvso