Bug 23975: (follow-up) Don't rely on save_to being present
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 13 Feb 2020 08:48:17 +0000 (08:48 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 3 Mar 2020 09:19:04 +0000 (09:19 +0000)
The `save_to` shortcut method was introduced to Mojolicious in version
8.02 but we still support 7.21 as our minimum dependancy and as such we
cannot yet use it.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

plugins/plugins-upload.pl

index 7f873fa..90b8730 100755 (executable)
@@ -75,7 +75,7 @@ if ($plugins_enabled) {
         if ( $uploadlocation ) {
             my $ua = Mojo::UserAgent->new(max_redirects => 5);
             my $tx = $ua->get($uploadlocation);
-            $tx->result->save_to($tempfile);
+            $tx->result->content->asset->move_to($tempfile);
         } else {
             $errors{'EMPTYUPLOAD'}    = 1 unless ( length($uploadfile) > 0 );
         }