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

CommentFileSizeAuthor
#2 2858275-remove-rules.patch259 bytesgnuget
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gnuget created an issue. See original summary.

gnuget’s picture

Status: Active » Needs review
FileSize
259 bytes

Patch attached.

gvso’s picture

First, 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?

gnuget’s picture

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?

I just tried this and all seems to be working as expected.

also, I created #2858267: Unused hybridauth which remove an unused dependency.

Thanks!

gvso’s picture

Issue summary: View changes

  • gvso committed 4b3d89a on 8.x-1.x
    Issue #2858275 by gnuget: Remove Rules as a dependency
    
gvso’s picture

Issue summary: View changes
Status: Needs review » Needs work

Thanks! Patch was committed. We need to update the documentation and project page.

gvso’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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