I've installed both the 1.x and 2.x versions and I get the same issue.

Steps to recreate

  1. Install the module via composer
  2. Configured the module at /admin/config/social-api/social-post/twitter
  3. Visit /admin/user/[uid]/edit
  4. Click the Add Account button in the Social Post Twitter section.
  5. Error is displayed.

Error message

The website encountered an unexpected error. Please try again later.
TypeError: Argument 4 passed to Drupal\social_api\Plugin\NetworkBase::__construct() must implement interface Drupal\Core\Logger\LoggerChannelFactoryInterface, instance of Drupal\Core\Entity\EntityTypeManager given, called in /var/www/web/modules/contrib/social_post_twitter/src/Plugin/Network/TwitterPost.php on line 91 in Drupal\social_api\Plugin\NetworkBase->__construct() (line 83 of modules/contrib/social_api/src/Plugin/NetworkBase.php).
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

oo0shiny created an issue. See original summary.

gvso’s picture

Do you get the same error if you install the dev version?

composer require drupal/social_post_twitter:2.x-dev

oo0shiny’s picture

I just tried it with the dev version and got a different error message:

The website encountered an unexpected error. Please try again later.</br></br><em
    class="placeholder">Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException</em>: You have
requested a non-existent service 'social_post.user_manager'. Did you mean one of these:
'social_post.post_manager', 'social_post.data_handler'? in <em
    class="placeholder">Drupal\Component\DependencyInjection\Container-&gt;get()</em> (line <em
    class="placeholder">153</em> of <em
    class="placeholder">core/lib/Drupal/Component/DependencyInjection/Container.php</em>)
gvso’s picture

Opps, try installing dev versions of Social Post and Social API

composer require drupal/social_post_twitter:2.x-dev drupal/social_post:2.x-dev drupal/social_api:2.x-dev

oo0shiny’s picture

Thanks, that seems to have worked! I was able to successfully add a Twitter account to a user when using the 2.x-dev versions of all the required modules.

JankaP’s picture

I have the same problem when I use the Add Account button in the Social Post area on the edit profil page.

Error:
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "social_post.user_manager". Did you mean one of these: "social_auth.user_manager", "social_post.post_manager", "social_post.data_handler"? in Drupal\Component\DependencyInjection\Container->get() (Zeile 153 in /www/xxx/drupal/core/lib/Drupal/Component/DependencyInjection/Container.php).

Versions:
Social API 8.x-2.0-rc2+1-dev (2019-Dez.-30)
Social Post 8.x-2.0-beta3
Social Post Twitter 8.x-2.0-alpha4+1-dev (2019-Aug.-11)
Social Auth 8.x-2.0-rc2 (I tried the dev version too)

gvso’s picture

For Social Post Twitter, you need to use the Social Post dev version. Social Auth shouldn't influence here. I will try to make a new release after some refactoring is done.

JankaP’s picture

I already use the dev version as mentioned for Sócial Post Twitter (8.x-2.0-alpha4+2-dev)?
Do I need to use another dev Version?

I also tried to use the Sócial Post dev version social_post 8.x-2.x-dev
But with that I get another error message when I try to click on User in the Config/Twitter menu

TypeError: Argument 4 passed to Drupal\social_post_twitter\Controller\TwitterPostController::__construct() must be an instance of Drupal\social_post\SocialPostDataHandler, instance of Drupal\social_post\DataHandler given, called in /wwwxxx/blabla.com/drupal/modules/social_post_twitter/src/Controller/TwitterPostController.php on line 114 in Drupal\social_post_twitter\Controller\TwitterPostController->__construct() (Zeile 81 in /wwwxxx/blabla.com/drupal/modules/social_post_twitter/src/Controller/TwitterPostController.php)

gvso’s picture

There has been changes in Social Post which broke Social Post Twitter. I have been trying to update it, but I am facing an issue with encrypting/decrypting the tokens. The work can be found at #3149947: Make controller similar to OAuth2 implementer controllels. Any help with that issue is very welcome!

gvso’s picture

JankaP’s picture

Is there any version combination of Social API, Social Post and Social Post Twitter with which I still can use Social Post Twitter function?

Aleksandr_Borovikov’s picture

Is there any progress in solving this problem?

Dom.’s picture

Status: Active » Needs review
FileSize
3.28 KB

I am having this module to work on Drupal 9. I will post a specific issue post to explain every changes and which versions I used, but meanwhile, here is a patch for that related issue.

Rar9’s picture

Gathering patches for root package.
Gathering patches for dependencies. This might take a minute.
- Installing drupal/social_post_twitter (2.0.0-alpha4): Extracting archive
- Applying patches for drupal/social_post_twitter
https://www.drupal.org/files/issues/2020-10-26/fix_tweet_rule_action--31... (Fix Tweet rule action)
https://www.drupal.org/files/issues/2020-10-25/link_drupal_user_twitter_... (Error when attempting to add account to user)
Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2020-10-25/link_drupal_user_twitter_...

  • wells committed b6ce405 on 3.x authored by Dom.
    Issue #3105779 by Dom., gvso, JankaP, Rar9: Error when attempting to add...
wells’s picture

Version: 8.x-2.0-alpha4 » 3.x-dev
Status: Needs review » Fixed

Thanks @Dom -- I have applied your patch to the new 3.x-dev branch. Still some issues but this gets us closer to have a working ecosystem again.

Status: Fixed » Closed (fixed)

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