Skip to content

Commit

Permalink
Item13897: Bug fixes
Browse files Browse the repository at this point in the history
- Fixed parent topic meta treated as an object.

- Fixed Oops exceptions not supplied with app param.
  • Loading branch information
vrurg committed Oct 10, 2016
1 parent 2e93bc1 commit 05f7777
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
17 changes: 8 additions & 9 deletions core/lib/Foswiki/UI/Edit.pm
Expand Up @@ -19,17 +19,9 @@ use Foswiki::OopsException ();
use Foswiki::Form ();
use Foswiki::Serialise ();

use Moo;
use namespace::clean;
use Foswiki::Class;
extends qw(Foswiki::UI);

BEGIN {
if ( $Foswiki::cfg{UseLocale} ) {
require locale;
import locale();
}
}

=begin TML
---++ StaticMethod edit( $session )
Expand Down Expand Up @@ -152,6 +144,7 @@ sub init_edit {
# use a 'keep' redirect to ensure we pass parameter
# values in the query on to the oops script
Foswiki::OopsException->throw(
app => $app,
template => 'leaseconflict',
def => $def,
web => $web,
Expand All @@ -169,6 +162,7 @@ sub init_edit {

# Topic exists and user requested oops if it exists
Foswiki::OopsException->throw(
app => $app,
template => 'attention',
def => 'topic_exists',
web => $web,
Expand All @@ -184,6 +178,7 @@ sub init_edit {

# do not allow non-wikinames
Foswiki::OopsException->throw(
app => $app,
template => 'attention',
def => 'not_wikiword',
web => $web,
Expand Down Expand Up @@ -258,6 +253,7 @@ sub init_edit {

unless ( $templateWeb && $templateTopic ) {
Foswiki::OopsException->throw(
app => $app,
template => 'accessdenied',
status => 403,
def => 'no_such_topic_template',
Expand Down Expand Up @@ -285,6 +281,7 @@ sub init_edit {
}
else {
Foswiki::OopsException->throw(
app => $app,
template => 'accessdenied',
status => 403,
def => 'no_such_topic_template',
Expand Down Expand Up @@ -386,6 +383,7 @@ sub init_edit {

unless ( $users->isAdmin($user) ) {
Foswiki::OopsException->throw(
app => $app,
template => 'accessdenied',
def => 'topic_access',
web => $web,
Expand All @@ -396,6 +394,7 @@ sub init_edit {

unless ( $adminCmd =~ m/^(rep|del)Rev$/ ) {
Foswiki::OopsException->throw(
app => $app,
template => 'attention',
def => 'unrecognized_action',
web => $web,
Expand Down
4 changes: 2 additions & 2 deletions core/lib/Foswiki/UI/Rename.pm
Expand Up @@ -327,9 +327,9 @@ sub _renameTopicOrAttachment {
my $meta = Foswiki::Meta->load( $app, $new->web, $new->topic );
my $parent = $meta->get('TOPICPARENT');
my ( $parentWeb, $parentTopic );
if ( $parent && defined $parent->name ) {
if ( $parent && defined $parent->{name} ) {
( $parentWeb, $parentTopic ) =
$req->normalizeWebTopicName( $oldWeb, $parent->name );
$req->normalizeWebTopicName( $oldWeb, $parent->{name} );
}
if ( $parentTopic
&& !( $parentWeb eq $oldWeb && $parentTopic eq $oldTopic )
Expand Down

0 comments on commit 05f7777

Please sign in to comment.