fixed a problem deleting a language translations
This commit is contained in:
@@ -285,6 +285,7 @@ class Content extends BaseContent {
|
|||||||
|
|
||||||
$c->add ( ContentPeer::CON_LANG, $lanId );
|
$c->add ( ContentPeer::CON_LANG, $lanId );
|
||||||
$result = ContentPeer::doSelectRS ( $c );
|
$result = ContentPeer::doSelectRS ( $c );
|
||||||
|
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
$result->next ();
|
$result->next ();
|
||||||
$row = $result->getRow ();
|
$row = $result->getRow ();
|
||||||
while ( is_array ( $row ) ) {
|
while ( is_array ( $row ) ) {
|
||||||
|
|||||||
@@ -132,6 +132,7 @@ try {
|
|||||||
include_once 'classes/model/Translation.php';
|
include_once 'classes/model/Translation.php';
|
||||||
include_once 'classes/model/Content.php';
|
include_once 'classes/model/Content.php';
|
||||||
$locale = $_POST['LOCALE'];
|
$locale = $_POST['LOCALE'];
|
||||||
|
$trn = new Translation();
|
||||||
|
|
||||||
if( strpos($locale, Translation::$localeSeparator) )
|
if( strpos($locale, Translation::$localeSeparator) )
|
||||||
list($LAN_ID, $IC_UID) = explode(Translation::$localeSeparator, $locale);
|
list($LAN_ID, $IC_UID) = explode(Translation::$localeSeparator, $locale);
|
||||||
@@ -154,7 +155,7 @@ try {
|
|||||||
if( $aRow[0] == 0 ) { //so we can delete this language
|
if( $aRow[0] == 0 ) { //so we can delete this language
|
||||||
try{
|
try{
|
||||||
Content::removeLanguageContent($locale);
|
Content::removeLanguageContent($locale);
|
||||||
Translation::removeTranslationEnvironment($locale);
|
$trn->removeTranslationEnvironment($locale);
|
||||||
echo G::LoadTranslation('ID_LANGUAGE_DELETED_SUCCESSFULLY');
|
echo G::LoadTranslation('ID_LANGUAGE_DELETED_SUCCESSFULLY');
|
||||||
} catch (Exception $e){
|
} catch (Exception $e){
|
||||||
echo $e->getMessage();
|
echo $e->getMessage();
|
||||||
@@ -167,4 +168,4 @@ try {
|
|||||||
} catch ( Exception $oException ) {
|
} catch ( Exception $oException ) {
|
||||||
die($oException->getMessage());
|
die($oException->getMessage());
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user