Skip to content

Commit

Permalink
Fix blob module to handle MP2 API stupidness
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Casadevall <mcasadevall@soylentnews.org>
  • Loading branch information
NCommander committed May 16, 2015
1 parent cee757b commit b843667
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
3 changes: 1 addition & 2 deletions Slash/Apache/User/User.pm
Expand Up @@ -88,7 +88,7 @@ sub handler {
my $reader_user = $slashdb->getDB('reader');
my $reader = getObject('Slash::DB', { virtual_user => $reader_user });

my $version_code = "slashcode";
my $version_code = "rehash";
$version_code .= " $Slash::VERSION";
if ($constants->{cvs_tag_currentcode_emit}
&& $constants->{cvs_tag_currentcode}
Expand Down Expand Up @@ -117,7 +117,6 @@ sub handler {

my $form = filter_params($apr);

$form->{query_apache} = $apr;
@{$form}{keys %{$constants->{form_override}}} =
values %{$constants->{form_override}};

Expand Down
12 changes: 10 additions & 2 deletions plugins/Admin/admin.pl
Expand Up @@ -12,6 +12,9 @@
use URI;
use Encode 'decode_utf8';

use Apache2::RequestUtil;
use Apache2::Request;
use Apache2::Upload;
use Slash;
use Slash::Display;
use Slash::Hook;
Expand Down Expand Up @@ -1105,7 +1108,10 @@ sub editStory {

# Basically, we upload the bodytext if we realize a name has been passed in -Brian
if ($form->{bodytext_file}) {
my $upload = $form->{query_apache}->upload;
my $r = Apache2::RequestUtil->request;
my $req = Apache2::Request->new($r);
my $upload = $req->upload("bodytext_file");

if ($upload) {
my $temp_body;
$form->{bodytext} = '';
Expand Down Expand Up @@ -1935,7 +1941,9 @@ sub handleMediaFileForStory {
my $savefile = !$saveblob;

if ($form->{media_file}) {
my $upload = $form->{query_apache}->upload;
my $r = Apache2::RequestUtil->request;
my $req = Apache2::Request->new($r);
my $upload = $req->upload("bodytext_file");
if ($upload) {
my $fh = $upload->fh;
use File::Path;
Expand Down
6 changes: 5 additions & 1 deletion plugins/Blob/fileadmin.pl
Expand Up @@ -11,6 +11,8 @@
use Slash::Display;
use Slash::Utility;

use Apache2::Upload;

use vars qw($VERSION);

($VERSION) = ' $Revision$ ' =~ /\$Revision:\s+([^\s]+)/;
Expand Down Expand Up @@ -100,7 +102,9 @@ sub addFileForStory {
if ($form->{file_content}) {
my $data;
if ($form->{file_content}) {
my $upload = $form->{query_apache}->upload;
my $r = Apache2::RequestUtil->request;
my $req = Apache2::Request->new($r);
my $upload = $req->upload("file_content");
if ($upload) {
my $temp_body;
my $fh = $upload->fh;
Expand Down

0 comments on commit b843667

Please sign in to comment.