]> git.proxmox.com Git - pmg-api.git/commitdiff
use otype() sub instead of $self->{otype}
authorDominik Csapak <d.csapak@proxmox.com>
Mon, 11 Sep 2017 11:23:02 +0000 (13:23 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 12 Sep 2017 05:06:08 +0000 (07:06 +0200)
the sub otype() is always the one defined in the class we instantiated,
but $self->{otype} is set at creation and does not work if we do not set
it in the 'new' sub of the object (for example in ContentTypeFilter.pm)

so now we get the correct otype from the current class

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PMG/RuleDB/Object.pm

index d459659594395bb8b8bb4a2b3c9234df2cbdbc92..b725a6f6e6065a1595bc9787b6c732b49bdb1d6e 100644 (file)
@@ -122,7 +122,7 @@ sub get_data {
 
     $data->{id} = $self->{id};
     $data->{ogroup} = $self->{ogroup};
-    $data->{otype} = $self->{otype};
+    $data->{otype} = $self->otype();
     $data->{otype_text} = $self->otype_text();
     $data->{receivertest} = $self->receivertest();
     $data->{descr} = $self->short_desc();