[Rt-commit] rt branch, master, updated. rt-4.4.1-117-gbc18344
Shawn Moore
shawn at bestpractical.com
Fri Sep 16 12:27:43 EDT 2016
The branch, master has been updated
via bc18344eb1dc49fa44a890b1978c0980f564ac2f (commit)
from 9c9cedebbb63e05ffbb226ff1461f09f6b3a83cc (commit)
Summary of changes:
etc/cpanfile | 2 +-
lib/RT/ExternalStorage/Dropbox.pm | 34 ++++++++++++----------------------
2 files changed, 13 insertions(+), 23 deletions(-)
- Log -----------------------------------------------------------------
commit bc18344eb1dc49fa44a890b1978c0980f564ac2f
Author: Aaron Kondziela <aaron at bestpractical.com>
Date: Thu Sep 15 20:55:58 2016 -0400
Bump File::Dropbox dependency and remove given/when warning hack
This updates the dependency check for File::Dropbox to >= 0.7
Version 0.7 fixes the code previously causing warnings like:
[warning]: given is experimental at ...
[warning]: when is experimental at ...
This commit also removes the workaround in ExternalStorage::Dropbox
that would hide the warnings, and updates the pod docs to reflect
the contemporary dropbox.com UX flow.
Fixes: I#32269
diff --git a/etc/cpanfile b/etc/cpanfile
index 59e4b3c..8cdc52b 100644
--- a/etc/cpanfile
+++ b/etc/cpanfile
@@ -208,5 +208,5 @@ feature 's3' => sub {
};
feature 'dropbox' => sub {
- requires 'File::Dropbox';
+ requires 'File::Dropbox', '>= 0.7';
};
diff --git a/lib/RT/ExternalStorage/Dropbox.pm b/lib/RT/ExternalStorage/Dropbox.pm
index 58aeea4..735cd23 100644
--- a/lib/RT/ExternalStorage/Dropbox.pm
+++ b/lib/RT/ExternalStorage/Dropbox.pm
@@ -70,28 +70,14 @@ sub AccessToken {
sub Init {
my $self = shift;
- {
- # suppress given/warn is experimental warnings from File::Dropbox 0.6
- # https://rt.cpan.org/Ticket/Display.html?id=108107
-
- my $original_warn_handler = $SIG{__WARN__};
- local $SIG{__WARN__} = sub {
- return if $_[0] =~ /(given|when) is experimental/;
-
- # Avoid reporting this anonymous call frame as the source of the warning.
- goto &$original_warn_handler;
- };
-
- if (not File::Dropbox->require) {
- RT->Logger->error("Required module File::Dropbox is not installed");
- return;
- } elsif (not $self->AccessToken) {
- RT->Logger->error("Required option 'AccessToken' not provided for Dropbox external storage. See the documentation for " . __PACKAGE__ . " for setting up this integration.");
- return;
- }
+ if (not File::Dropbox->require) {
+ RT->Logger->error("Required module File::Dropbox is not installed");
+ return;
+ } elsif (not $self->AccessToken) {
+ RT->Logger->error("Required option 'AccessToken' not provided for Dropbox external storage. See the documentation for " . __PACKAGE__ . " for setting up this integration.");
+ return;
}
-
my $dropbox = File::Dropbox->new(
oauth2 => 1,
access_token => $self->AccessToken,
@@ -184,7 +170,7 @@ Choose B<Dropbox API app> as the type of app.
=item 4.
-Choose B<Yes>, your application only needs access to files it creates.
+Choose B<App Folder> for the Type of Access; your application only needs access to files it creates.
=item 5.
@@ -192,10 +178,14 @@ Enter a descriptive name -- C<Request Tracker files> is fine.
=item 6.
-Under C<Generated access token>, click the C<Generate> button.
+Check the checkbox for B<Terms and Conditions> (if present) and then click C<Create App>.
=item 7.
+Under C<Generated access token>, click the C<Generate> button.
+
+=item 8.
+
Copy the provided value into your F<RT_SiteConfig.pm> file as the
C<AccessToken>:
-----------------------------------------------------------------------
More information about the rt-commit
mailing list