From bc7fa44cf1e045930389357229ae564318e82d66 Mon Sep 17 00:00:00 2001 From: Jean-Yves Gaulier Date: Wed, 6 Apr 2016 16:46:54 +0200 Subject: [PATCH] PHRAS-1055 #time 15m - fix fatal error "getName()" --- lib/Alchemy/Phrasea/Command/BuildSubdefs.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/Alchemy/Phrasea/Command/BuildSubdefs.php b/lib/Alchemy/Phrasea/Command/BuildSubdefs.php index b927744c2c..55446b7de0 100644 --- a/lib/Alchemy/Phrasea/Command/BuildSubdefs.php +++ b/lib/Alchemy/Phrasea/Command/BuildSubdefs.php @@ -179,14 +179,13 @@ class BuildSubdefs extends Command if($this->databox !== null) { - /** @var SubdefGroup $sg */ - foreach ($this->databox->get_subdef_structure() as $sg) { - if (empty($types) || in_array($sg->getName(), $types)) { - $this->subdefsNameByType[$sg->getName()] = []; + foreach ($this->databox->get_subdef_structure() as $sgname=>$sg) { + if (empty($types) || in_array($sgname, $types)) { + $this->subdefsNameByType[$sgname] = []; /** @var databox_subdef $sd */ foreach ($sg as $sd) { if (empty($names) || in_array($sd->get_name(), $names)) { - $this->subdefsNameByType[$sg->getName()][] = $sd->get_name(); + $this->subdefsNameByType[$sgname][] = $sd->get_name(); } } }