Changeset 1897

Show
Ignore:
Timestamp:
04/22/06 16:29:15 (10 months ago)
Author:
demian
Message:

fixed probs where failing to select langs during install results in fatal error

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/0.6-bugfix/CHANGELOG.txt

    r1893 r1897  
    55+-----------------------+ 
    66BUGFIXES 
     722-05-06    Fixed problem where selecting 'store langs in DB' during install, but 
     8            then selecting none from list resulted in a fatal error (Heinrich Stoellinger) 
    7921-05-06    DB_DataObject fails to overwrite an existing keys file with 'rebuild 
    810            dataobjects', now file removal forces update 
  • branches/0.6-bugfix/lib/SGL/ParamHandler.php

    r1891 r1897  
    122122    { 
    123123        if (is_file($this->source)) { 
    124             $ok = @require $this->source; 
     124            $ok = require $this->source; 
    125125            if ($ok) { 
    126126                $ret = $conf; 
  • branches/0.6-bugfix/lib/SGL/Task/Install.php

    r1893 r1897  
    593593            $availableLanguages = & $GLOBALS['_SGL']['LANGUAGE']; 
    594594 
    595             //  add languaged to inifile container 
     595            //  add languages to config 
    596596            $this->installedLanguages = $data['installLangs']; 
    597  
    598             $c->set('translation', array('installedLanguages' => implode(',', 
    599                 str_replace('-', '_', $data['installLangs']))))
    600  
     597            $langString = (is_array($data['installLangs'])) 
     598                ? implode(',', str_replace('-', '_', $data['installLangs'])) 
     599                : ''
     600            $c->set('translation', array('installedLanguages' => $langString)); 
    601601            $ok = $c->save($configFile); 
    602602            if (PEAR::isError($ok)) { 
     
    604604            } 
    605605 
    606             //  interate through languages adding to langs table 
    607             foreach ($data['installLangs'] as $aKey => $aLang) { 
     606            //  iterate through languages adding to langs table 
     607            foreach ($data['installLangs'] as $aLang) { 
    608608                $globalLangFile = $availableLanguages[$aLang][1] .'.php'; 
    609609                $langID = str_replace('-', '_', $aLang); 
    610                 $encoding       = substr($aLang, strpos('-', $aLang)); 
    611                 $langData       = array( 
     610                $encoding = substr($aLang, strpos('-', $aLang)); 
     611                $langData  = array( 
    612612                    'lang_id' => $langID, 
    613613                    'table_name' => $this->conf['table']['translation'] .'_'. $langID, 
     
    657657        } else { 
    658658            //  set installed languages 
    659             $installedLangs = implode(',', str_replace('-', '_', array_keys($aLangOptions))); 
     659            $installedLangs = (is_array($aLangOptions)) 
     660                ? implode(',', str_replace('-', '_', array_keys($aLangOptions))) 
     661                : ''; 
    660662 
    661663            $c->set('translation', array('installedLanguages' => $installedLangs));