Loading config/schema/disqus.schema.yml +13 −2 Original line number Diff line number Diff line # Schema for the configuration files of the disqus module. disqus.settings: type: mapping type: config_object label: 'Disqus Settings' mapping: disqus_domain: Loading @@ -9,7 +9,7 @@ disqus.settings: label: 'Shortname' behavior: type: mapping label: "Behavior" label: 'Behavior' mapping: disqus_localization: type: boolean Loading Loading @@ -59,3 +59,14 @@ disqus.settings: disqus_logo: type: uri label: 'Custom Logo' field.value.disqus_comment: type: mapping label: 'Disqus field values' mapping: status: type: boolean label: 'Disqus comments should be shown' identifier: type: string label: 'Identifier of the Disqus discussion' disqus.info.yml +1 −0 Original line number Diff line number Diff line Loading @@ -4,4 +4,5 @@ description: 'Integrated the Disqus web service to enhance comments in Drupal.' core_version_requirement: ^8.8 || ^9 configure: disqus.settings dependencies: - drupal:file - drupal:field src/DisqusCommentManager.php +14 −2 Original line number Diff line number Diff line Loading @@ -110,9 +110,21 @@ class DisqusCommentManager implements DisqusCommentManagerInterface { $disqus['sso'] = [ 'name' => $this->configFactory->get('system.site')->get('name'), // The login window must be closed once the user logs in. 'url' => Url::fromRoute('user.login', [], ['query' => ['destination' => Url::fromRoute('disqus.close_window')->toString()], 'absolute' => TRUE])->toString(), 'url' => Url::fromRoute('user.login', [], [ 'query' => [ 'destination' => Url::fromRoute('disqus.close_window')->toString(), ], 'absolute' => TRUE, ] )->toString(), // The logout link must redirect back to the original page. 'logout' => Url::fromRoute('user.logout', [], ['query' => ['destination' => Url::fromRoute('<current>')->toString()], 'absolute' => TRUE])->toString(), 'logout' => Url::fromRoute('user.logout', [], [ 'query' => [ 'destination' => Url::fromRoute('<current>')->toString(), ], 'absolute' => TRUE, ] )->toString(), 'width' => 800, 'height' => 600, ]; Loading src/Form/DisqusSettingsForm.php +4 −2 Original line number Diff line number Diff line Loading @@ -97,7 +97,6 @@ class DisqusSettingsForm extends ConfigFormBase { $form['settings'] = [ '#type' => 'vertical_tabs', '#attached' => ['library' => ['disqus/disqus.settings']], '#weight' => 50, ]; Loading Loading @@ -300,7 +299,10 @@ class DisqusSettingsForm extends ConfigFormBase { } $old_logo = $config->get('advanced.sso.disqus_logo'); $new_logo = (!$form_state->isValueEmpty('disqus_logo')) ? $form_state->getValue(['disqus_logo', 0]) : ''; $new_logo = (!$form_state->isValueEmpty('disqus_logo')) ? $form_state->getValue([ 'disqus_logo', 0, ]) : ''; // Ignore if the file hasn't changed. if ($new_logo != $old_logo) { Loading src/Plugin/migrate/destination/DisqusComment.php +4 −1 Original line number Diff line number Diff line Loading @@ -166,7 +166,10 @@ class DisqusComment extends DestinationBase implements ContainerFactoryPluginInt return $ids; } catch (\Exception $exception) { $this->logger->error('Error creating post on thread @thread, error: @error', ['@thread' => $thread->id, '@error' => $exception->getMessage()]); $this->logger->error('Error creating post on thread @thread, error: @error', [ '@thread' => $thread->id, '@error' => $exception->getMessage(), ]); } return FALSE; } Loading Loading
config/schema/disqus.schema.yml +13 −2 Original line number Diff line number Diff line # Schema for the configuration files of the disqus module. disqus.settings: type: mapping type: config_object label: 'Disqus Settings' mapping: disqus_domain: Loading @@ -9,7 +9,7 @@ disqus.settings: label: 'Shortname' behavior: type: mapping label: "Behavior" label: 'Behavior' mapping: disqus_localization: type: boolean Loading Loading @@ -59,3 +59,14 @@ disqus.settings: disqus_logo: type: uri label: 'Custom Logo' field.value.disqus_comment: type: mapping label: 'Disqus field values' mapping: status: type: boolean label: 'Disqus comments should be shown' identifier: type: string label: 'Identifier of the Disqus discussion'
disqus.info.yml +1 −0 Original line number Diff line number Diff line Loading @@ -4,4 +4,5 @@ description: 'Integrated the Disqus web service to enhance comments in Drupal.' core_version_requirement: ^8.8 || ^9 configure: disqus.settings dependencies: - drupal:file - drupal:field
src/DisqusCommentManager.php +14 −2 Original line number Diff line number Diff line Loading @@ -110,9 +110,21 @@ class DisqusCommentManager implements DisqusCommentManagerInterface { $disqus['sso'] = [ 'name' => $this->configFactory->get('system.site')->get('name'), // The login window must be closed once the user logs in. 'url' => Url::fromRoute('user.login', [], ['query' => ['destination' => Url::fromRoute('disqus.close_window')->toString()], 'absolute' => TRUE])->toString(), 'url' => Url::fromRoute('user.login', [], [ 'query' => [ 'destination' => Url::fromRoute('disqus.close_window')->toString(), ], 'absolute' => TRUE, ] )->toString(), // The logout link must redirect back to the original page. 'logout' => Url::fromRoute('user.logout', [], ['query' => ['destination' => Url::fromRoute('<current>')->toString()], 'absolute' => TRUE])->toString(), 'logout' => Url::fromRoute('user.logout', [], [ 'query' => [ 'destination' => Url::fromRoute('<current>')->toString(), ], 'absolute' => TRUE, ] )->toString(), 'width' => 800, 'height' => 600, ]; Loading
src/Form/DisqusSettingsForm.php +4 −2 Original line number Diff line number Diff line Loading @@ -97,7 +97,6 @@ class DisqusSettingsForm extends ConfigFormBase { $form['settings'] = [ '#type' => 'vertical_tabs', '#attached' => ['library' => ['disqus/disqus.settings']], '#weight' => 50, ]; Loading Loading @@ -300,7 +299,10 @@ class DisqusSettingsForm extends ConfigFormBase { } $old_logo = $config->get('advanced.sso.disqus_logo'); $new_logo = (!$form_state->isValueEmpty('disqus_logo')) ? $form_state->getValue(['disqus_logo', 0]) : ''; $new_logo = (!$form_state->isValueEmpty('disqus_logo')) ? $form_state->getValue([ 'disqus_logo', 0, ]) : ''; // Ignore if the file hasn't changed. if ($new_logo != $old_logo) { Loading
src/Plugin/migrate/destination/DisqusComment.php +4 −1 Original line number Diff line number Diff line Loading @@ -166,7 +166,10 @@ class DisqusComment extends DestinationBase implements ContainerFactoryPluginInt return $ids; } catch (\Exception $exception) { $this->logger->error('Error creating post on thread @thread, error: @error', ['@thread' => $thread->id, '@error' => $exception->getMessage()]); $this->logger->error('Error creating post on thread @thread, error: @error', [ '@thread' => $thread->id, '@error' => $exception->getMessage(), ]); } return FALSE; } Loading