Bug#850956: gosa-plugin-netgroups: fails to show the content of netgroup list entry (e.g. workstation-hosts)

Wolfgang Schweer w.schweer at gmx.de
Fri Jan 20 22:29:11 UTC 2017


Hi Mike.

On Fri, Jan 20, 2017 at 01:19:11PM +0000, Mike Gabriel wrote:
> The most likely thing to happen when naming the function __netgrouptabs() is
> that it is not executed at all, but instead parent::__construct() gets
> executed.
> 
> ```
>     function netgrouptabs($config, $data, $dn, $cat = "", $hide_refs =
> FALSE, $hide_acls = FALSE) {
>         tabs::__plugin($config, $data, $dn, "netgroups", $hide_refs,
> $hide_acls);
>         $this->addSpecialTabs();
>     }
> ```
> 
> So what happens is that $this->addSpecialTabs(); will not get called when
> instantiating the tabs. This results in missing tabs: ACL, References. I
> guess, those are missing in your setup now, right?

Yes, you're right. The missing tabs slipped my attention.
 
> In object oriented programming, giving method names same names is common
> practice, so the method netgrouptabs::__construct() will overload the method
> parent::__construct() (i.e. tabs::__construct() here). The new
> method has to mimmick the parent's method's functionality (by simply calling
> it in most cases) and add some extra magic possibly.

Thanks for the explanation.

> I will now upload a fix for this (using __construct() ) with delay of 2 days
> so you can veto and cross check once more. Thanks!

As far as I can tell it should rather be: 

diff --git a/debian/patches/1003_php7-compliance.patch b/debian/patches/1003_php7-compliance.patch
index b17b39b..76a29e8 100644
--- a/debian/patches/1003_php7-compliance.patch
+++ b/debian/patches/1003_php7-compliance.patch
@@ -58,7 +58,7 @@ Author: Wolfgang Schweer <wschweer at arcor.de>
 -    function netgrouptabs($config, $data, $dn, $cat = "", $hide_refs = FALSE, $hide_acls = FALSE) {
 -        tabs::tabs($config, $data, $dn, "netgroups", $hide_refs, $hide_acls);
 +    function __construct($config, $data, $dn, $cat = "", $hide_refs = FALSE, $hide_acls = FALSE) {
-+        tabs::__plugin($config, $data, $dn, "netgroups", $hide_refs, $hide_acls);
++        tabs::__construct($config, $data, $dn, "netgroups", $hide_refs, $hide_acls);
          $this->addSpecialTabs();
      }
  
IMO the real reason why __construct was failing as replacement for 
netgrouptabs was tabs::__plugin which should have been 
tabs::__construct.

Wolfgang
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/debian-edu-pkg-team/attachments/20170120/3b8b8e88/attachment.sig>


More information about the Debian-edu-pkg-team mailing list