BUG 9040 "The Task column doesn't update whith the last changes on..." SOLVED

- The APP_CACHE_VIEW table does not contain the changes made in the CONTENT table when you rename processes/tasks
- The name change in processes/tasks is now reflected in the APP_CACHE_VIEW table
- Note.- The APP_CACHE_VIEW table contains values ..for only one language
This commit is contained in:
Victor Saisa Lopez
2012-05-10 11:06:44 -04:00
parent c62f18b054
commit c4af5f8d23
5 changed files with 102 additions and 6 deletions

View File

@@ -1066,7 +1066,7 @@ class AppCacheView extends BaseAppCacheView {
if ( ! $found ) {
$filenameSql = $this->pathToAppCacheFiles . '/triggerApplicationUpdate.sql';
if ( !file_exists ( $filenameSql ) )
throw ( new Exception ( "file triggerAppDelegationUpdate.sql doesn't exist ") );
throw ( new Exception ( "file triggerApplicationUpdate.sql doesn't exist ") );
$sql = file_get_contents ( $filenameSql );
$sql = str_replace('{lang}', $lang, $sql);
$stmt->executeQuery($sql);
@@ -1103,7 +1103,7 @@ class AppCacheView extends BaseAppCacheView {
if ( ! $found ) {
$filenameSql = $this->pathToAppCacheFiles . '/triggerApplicationDelete.sql';
if ( !file_exists ( $filenameSql ) )
throw ( new Exception ( "file triggerAppDelegationDelete.sql doesn't exist") );
throw ( new Exception ( "file triggerApplicationDelete.sql doesn't exist") );
$sql = file_get_contents ( $filenameSql );
$sql = str_replace('{lang}', $lang, $sql);
$stmt->executeQuery($sql);
@@ -1111,6 +1111,45 @@ class AppCacheView extends BaseAppCacheView {
}
return 'exists';
}
function triggerContentUpdate($lang, $recreate = false)
{
$cnn = Propel::getConnection("workflow");
$stmt = $cnn->createStatement();
$rs = $stmt->executeQuery("Show TRIGGERS", ResultSet::FETCHMODE_ASSOC);
$found = false;
while ($rs->next()) {
$row = $rs->getRow();
if (strtolower($row["Trigger"] == "CONTENT_UPDATE") && strtoupper($row["Table"]) == "CONTENT") {
$found = true;
}
}
if ($recreate) {
$rs = $stmt->executeQuery("DROP TRIGGER IF EXISTS CONTENT_UPDATE");
$found = false;
}
if (!$found) {
$filenameSql = $this->pathToAppCacheFiles . PATH_SEP . "triggerContentUpdate.sql";
if (!file_exists($filenameSql)) {
throw (new Exception("file triggerContentUpdate.sql doesn't exist"));
}
$sql = file_get_contents($filenameSql);
$sql = str_replace("{lang}", $lang, $sql);
$stmt->executeQuery($sql);
return "created";
}
return "exists";
}
/**
* Retrieve the SQL code to create the APP_CACHE_VIEW triggers.
@@ -1122,7 +1161,8 @@ class AppCacheView extends BaseAppCacheView {
'triggerApplicationDelete.sql',
'triggerApplicationUpdate.sql',
'triggerAppDelegationUpdate.sql',
'triggerAppDelegationInsert.sql');
'triggerAppDelegationInsert.sql',
'triggerContentUpdate.sql');
$triggers = array();
foreach ($triggerFiles as $triggerFile) {
$trigger = file_get_contents("{$this->pathToAppCacheFiles}/$triggerFile");