Skip to content
Browse files

oops, handle nostate where form->reskey is true

  • Loading branch information...
1 parent 5c1f5b9 commit b2b67cc830e6da201d5d78d3d4cfe723c30a6d0d @pudge pudge committed
Showing with 9 additions and 6 deletions.
  1. +3 −3 plugins/Journal/journal.pl
  2. +6 −3 plugins/ResKey/ResKey/Key.pm
View
6 plugins/Journal/journal.pl
@@ -576,9 +576,9 @@ sub doSaveArticle {
# not enabled with SOAP now anyway
if ($form->{submit}) {
my $reskey = getObject('Slash::ResKey');
- my $rkey = $reskey->key('submit', { nostate => 1 });
- unless ($rkey->createuse) {
- return($rkey->errstr, $rkey->failure);
+ my $submit_rkey = $reskey->key('submit', { nostate => 1 });
+ unless ($submit_rkey->createuse) {
+ return($submit_rkey->errstr, $submit_rkey->failure);
}
}
View
9 plugins/ResKey/ResKey/Key.pm
@@ -149,12 +149,15 @@ sub new {
# from filter_param
- $reskey =~ s|[^a-zA-Z0-9_]+||g if $reskey;
+ if ($reskey) {
+ $reskey =~ s|[^a-zA-Z0-9_]+||g;
+ } elsif (!defined $reskey) {
+ $reskey = $opts->{nostate} ? '' : getCurrentForm('reskey');
+ }
# reskey() to set the value is called only here and from dbCreate
# this is the only place $form->{reskey} is looked at
- $self->reskey(defined $reskey ? $reskey : getCurrentForm('reskey'));
-
+ $self->reskey($reskey);
$self->_init;

0 comments on commit b2b67cc

Please sign in to comment.
Something went wrong with that request. Please try again.