[Rt-commit] rt branch, 4.4/bump-dropbox-dep-remove-hack-I32269, created. rt-4.4.1-112-g21283f1
Aaron Kondziela
aaron at bestpractical.com
Thu Sep 15 21:25:57 EDT 2016
The branch, 4.4/bump-dropbox-dep-remove-hack-I32269 has been created
at 21283f1913436e40d7e7a83ae0f36e47e906d57d (commit)
- Log -----------------------------------------------------------------
commit 21283f1913436e40d7e7a83ae0f36e47e906d57d
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/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>:
diff --git a/sbin/rt-test-dependencies.in b/sbin/rt-test-dependencies.in
index 0e57ca1..9ef5b59 100644
--- a/sbin/rt-test-dependencies.in
+++ b/sbin/rt-test-dependencies.in
@@ -306,7 +306,7 @@ Amazon::S3
.
$deps{'DROPBOX'} = [ text_to_hash( <<'.') ];
-File::Dropbox
+File::Dropbox 0.7
.
my %AVOID = (
-----------------------------------------------------------------------
More information about the rt-commit
mailing list