๐Ÿ‡บ๐Ÿ‡ธUnited States @cainaru

Norwood, NY, USA
Account created on 18 October 2014, about 10 years ago
  • Technical Architect at Acquiaย  โ€ฆ
#

Recent comments

๐Ÿ‡บ๐Ÿ‡ธUnited States cainaru Norwood, NY, USA

The only con I can see to the usage of โ€œInstallโ€ is that, to some end users, that might imply that there must be some โ€œUninstallโ€ mechanism to recipes (similar to installing/uninstalling an app on your phone or computer).

๐Ÿ‡บ๐Ÿ‡ธUnited States cainaru Norwood, NY, USA
๐Ÿ‡บ๐Ÿ‡ธUnited States cainaru Norwood, NY, USA
๐Ÿ‡บ๐Ÿ‡ธUnited States cainaru Norwood, NY, USA

+ My Ukrainian relatives on my dadโ€™s side are still under threat, the war is not over yet. Letโ€™s not become desensitized please

๐Ÿ‡บ๐Ÿ‡ธUnited States cainaru Norwood, NY, USA

A while back when testing this, I noticed that other feeds that are using HTTP Basic Auth, but not Oauth, start failing with this patch. I wonder if modifying the submitConfigurationForm like the following might help (particularly with the failing tests) ?

  public function submitConfigurationForm(array &$form, FormStateInterface $form_state, FeedInterface $feed = NULL) {
    $feed->setSource($form_state->getValue('source'));
    // Only submit these if the feed has the Oauth option present.
    if (isset($form_state->getValue('authorization_options')['feed_authorization_setting'])) {
      $feed_config = [
        'feed_authorization_setting' => $form_state->getValue('authorization_options')['feed_authorization_setting'],
        'access_token_url' => $form_state->getValue('authorization_options')['access_token_url'],
        'grant_type' => $form_state->getValue('authorization_options')['grant_type'],
        'client_id' => $form_state->getValue('authorization_options')['client_id'],
        'scope' => $form_state->getValue('authorization_options')['scope'],
        'username' => $form_state->getValue('authorization_options')['username'],
      ];
      $client_secret = $form_state->getValue('authorization_options')['client_secret'];
      $password = $form_state->getValue('authorization_options')['password'];

      // Only save the client secret and/or password if they have been changed.
      if (!empty($client_secret)) {
        $feed_config['client_secret'] = $client_secret;
      }
      if (!empty($password)) {
        $feed_config['password'] = $password;
      }
      $feed->setConfigurationFor($this->plugin, $feed_config);
    }
  }

And perhaps setting the feed_authorization_setting to FALSE in defaultFeedConfiguration()?

Production build 0.71.5 2024