Index: branches/RC/core/kernel/application.php =================================================================== diff -u -r10274 -r10334 --- branches/RC/core/kernel/application.php (.../application.php) (revision 10274) +++ branches/RC/core/kernel/application.php (.../application.php) (revision 10334) @@ -2226,16 +2226,23 @@ * @access public * @author Kostja / Alex */ - function GetTopmostPrefix($current_prefix, $real_top=false) + function GetTopmostPrefix($current_prefix, $real_top = false) { // 1. get genealogical tree of $current_prefix $prefixes = Array ($current_prefix); while ( $parent_prefix = $this->getUnitOption($current_prefix, 'ParentPrefix') ) { + if (!$this->prefixRegistred($parent_prefix)) { + // stop searching, when parent prefix is not registered + break; + } + $current_prefix = $parent_prefix; array_unshift($prefixes, $current_prefix); } - if ($real_top) return $current_prefix; + if ($real_top) { + return $current_prefix; + } // 2. find what if parent is passed $passed = explode(',', $this->GetVar('all_passed'));