@@ -, +, @@ DB admin account --- Koha/Exceptions.pm | 4 ++++ Koha/Virtualshelf.pm | 4 ++++ koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt | 2 ++ 3 files changed, 10 insertions(+) --- a/Koha/Exceptions.pm +++ a/Koha/Exceptions.pm @@ -28,6 +28,10 @@ use Exception::Class ( 'Koha::Exceptions::Virtualshelves::ShareHasExpired' => { isa => 'Koha::Exceptions::Exception', description=> 'Cannot share this shelf, the share has expired', + }, + 'Koha::Exceptions::Virtualshelves::UseDbAdminAccount' => { + isa => 'Koha::Exceptions::Exception', + description => "Invalid use of database administrator account", } ); --- a/Koha/Virtualshelf.pm +++ a/Koha/Virtualshelf.pm @@ -51,6 +51,10 @@ our $PUBLIC = 2; sub store { my ( $self ) = @_; + unless ( $self->owner ) { + Koha::Exceptions::Virtualshelves::UseDbAdminAccount->throw; + } + unless ( $self->is_shelfname_valid ) { Koha::Exceptions::Virtualshelves::DuplicateObject->throw; } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt @@ -351,6 +351,8 @@ function placeHold () { No biblio has been removed. [% CASE 'Koha::Exceptions::Virtualshelves::DuplicateObject' %] An error occurred when inserting this list. The name already [% shelfname %] exists. + [% CASE 'Koha::Exceptions::Virtualshelves::UseDbAdminAccount' %] + List could not be created. (Do not use the database administrator account.). [% CASE 'DBIx::Class::Exception' %] [% m.msg %] [% CASE %] --