BUG-9980: Wrong language on case listings, column Task SOLVED
- No se actualizaban todos los registros de la tabla content de acuerdo a los parematros especificados. - ahora al realizar una modificacion en algun label se modifican todos esos registros de diferente idioma con el mismo label.
This commit is contained in:
@@ -104,6 +104,43 @@ class Content extends BaseContent
|
|||||||
return ($defaultLang);
|
return ($defaultLang);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Change the value of all records
|
||||||
|
* @param string $ConCategory
|
||||||
|
* @param string $ConParent
|
||||||
|
* @param string $ConId
|
||||||
|
* @param string $ConValue
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function updateEqualValue ($ConCategory, $ConParent, $ConId, $ConValue)
|
||||||
|
{
|
||||||
|
$Criteria = new Criteria( 'workflow' );
|
||||||
|
$Criteria->clearSelectColumns()->clearOrderByColumns();
|
||||||
|
|
||||||
|
$Criteria->addSelectColumn( ContentPeer::CON_CATEGORY );
|
||||||
|
$Criteria->addSelectColumn( ContentPeer::CON_PARENT );
|
||||||
|
$Criteria->addSelectColumn( ContentPeer::CON_ID );
|
||||||
|
$Criteria->addSelectColumn( ContentPeer::CON_LANG );
|
||||||
|
|
||||||
|
$Criteria->add( ContentPeer::CON_CATEGORY, $ConCategory, CRITERIA::EQUAL );
|
||||||
|
$Criteria->add( ContentPeer::CON_PARENT, $ConParent, CRITERIA::EQUAL );
|
||||||
|
$Criteria->add( ContentPeer::CON_ID, $ConId, CRITERIA::EQUAL );
|
||||||
|
|
||||||
|
$rs = ContentPeer::doSelectRS( $Criteria );
|
||||||
|
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||||
|
while ($rs->next()) {
|
||||||
|
$row = $rs->getRow();
|
||||||
|
$con = ContentPeer::retrieveByPK( $row['CON_CATEGORY'], $row['CON_PARENT'], $row['CON_ID'] , $row['CON_LANG'] );
|
||||||
|
$con->setConCategory( $row['CON_CATEGORY'] );
|
||||||
|
$con->setConParent( $row['CON_PARENT'] );
|
||||||
|
$con->setConId( $row['CON_ID'] );
|
||||||
|
$con->setConLang( $row['CON_LANG'] );
|
||||||
|
$con->setConValue( $ConValue );
|
||||||
|
$res = $con->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Load the content row and the Save automatically the row for the destination language
|
* Load the content row and the Save automatically the row for the destination language
|
||||||
* @param string $ConCategory
|
* @param string $ConCategory
|
||||||
@@ -188,6 +225,7 @@ class Content extends BaseContent
|
|||||||
$con->setConValue( $ConValue );
|
$con->setConValue( $ConValue );
|
||||||
if ($con->validate()) {
|
if ($con->validate()) {
|
||||||
$res = $con->save();
|
$res = $con->save();
|
||||||
|
Content::updateEqualValue( $ConCategory, $ConParent, $ConId, $ConValue );
|
||||||
return $res;
|
return $res;
|
||||||
} else {
|
} else {
|
||||||
$e = new Exception( "Error in addcontent, the row $ConCategory, $ConParent, $ConId, $ConLang is not Valid" );
|
$e = new Exception( "Error in addcontent, the row $ConCategory, $ConParent, $ConId, $ConLang is not Valid" );
|
||||||
|
|||||||
Reference in New Issue
Block a user