- Issue created by @Nicolas S.
- Assigned to sarwan_verma
- 🇫🇷France Nicolas S. Lyon, France
With this diff a fix more error but now on this form settings /admin/config/social-api/social-auth/twitter
I have this error but I don't see where it is
Uncaught PHP Exception Symfony\\Component\\Routing\\Exception\\RouteNotFoundException: "Route "" does not exist." at /var/www/html/project/www/core/lib/Drupal/Core/Routing/RouteProvider.php line 206
diff --git a/social_auth_twitter/src/Form/TwitterAuthSettingsForm.php b/social_auth_twitter/src/Form/TwitterAuthSettingsForm.php
index fb976a351..7b8f0a229 100644
--- a/social_auth_twitter/src/Form/TwitterAuthSettingsForm.php
+++ b/social_auth_twitter/src/Form/TwitterAuthSettingsForm.php
@@ -33,6 +33,10 @@ protected function getEditableConfigNames(): array {
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state, ?NetworkInterface $network = NULL): array {
+ /** @var \Drupal\social_auth\Plugin\Network\NetworkInterface $network */
+ $network = $this->networkManager->createInstance('social_auth_twitter');
+ $form = parent::buildForm($form, $form_state, $network);
+
$config = $this->config('social_auth_twitter.settings');$form['twitter_settings'] = [
@@ -65,7 +69,7 @@ public function buildForm(array $form, FormStateInterface $form_state, ?NetworkI
'#default_value' => Url::fromRoute('social_auth_twitter.callback')->setAbsolute()->toString(),
];- return parent::buildForm($form, $form_state);
+ return $form;
}/**
diff --git a/social_auth_twitter/src/Plugin/Network/TwitterAuth.php b/social_auth_twitter/src/Plugin/Network/TwitterAuth.php
index d442d9154..ccd99787b 100644
--- a/social_auth_twitter/src/Plugin/Network/TwitterAuth.php
+++ b/social_auth_twitter/src/Plugin/Network/TwitterAuth.php
@@ -6,6 +6,7 @@
use Drupal\social_api\SocialApiException;
use Drupal\social_auth\Plugin\Network\NetworkBase;
use Abraham\TwitterOAuth\TwitterOAuth;
+use Drupal\social_auth\Settings\SettingsInterface;
use Drupal\social_auth_twitter\Settings\TwitterAuthSettingsInterface;/**
@@ -28,7 +29,7 @@ class TwitterAuth extends NetworkBase implements TwitterAuthInterface {
/**
* {@inheritdoc}
*/
- public function initSdk() {
+ public function initSdk(): mixed {
$class_name = '\Abraham\TwitterOAuth\TwitterOAuth';if (!class_exists($class_name)) {
@@ -88,7 +89,7 @@ public function getSdk2($oauth_token, $oauth_token_secret) {
* True if module is configured.
* False otherwise.
*/
- protected function validateConfig(TwitterAuthSettingsInterface $settings) {
+ protected function validateConfig(SettingsInterface $settings): bool {
$consumer_key = $settings->getConsumerKey();
$consumer_secret = $settings->getConsumerSecret();
if (!$consumer_key || !$consumer_secret) {