Problem installing 0.6.5 with class auditevent-serializeddata
#1
Posted 19 May 2012 - 11:49 AM
I've trying to install the version 0.6.5, but during the install the following error occurs
SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'serializeddata' at row 1
After some investigation I found that the auditevent event table is created with the field serializeddata as VARCHAR(255), if we change it to TEXT the installation works fine.
How can we force the creation of this field as TEXT?
#2
Posted 19 May 2012 - 01:45 PM
Jason Green
Zurmo Team
Need support? Upgrade now
#3
Posted 19 May 2012 - 02:16 PM
http://hg.zurmo.org/...et/47d85ab204da
You can easily make this change locally. Please let us know if it works. Also check the About page in the app
Jason Green
Zurmo Team
Need support? Upgrade now
#4
Posted 19 May 2012 - 03:46 PM
As a workaround only to finish the installation we can change the method protected->modules->zurmo-models->AuditEvent->logAuditEvent as specified below. Doing this change the table have the column as TEXT and the application works.
public static function logAuditEvent($moduleName, $eventName, $data = null, RedBeanModel $model = null, User $user = null)
{
assert('is_string($moduleName) && $moduleName != ""');
assert('is_string($eventName) && $eventName != ""');
if ($user === null)
{
$user = Yii::app()->user->userModel;
if (!$user instanceof User)
{
throw new NoCurrentUserSecurityException();
}
}
if (!AuditEvent::$isTableOptimized && (!AUDITING_OPTIMIZED || !RedBeanDatabase::isFrozen()))
{
$tableName = self::getTableName('AuditEvent');
RedBean_Plugin_Optimizer_Id::ensureIdColumnIsINT11($tableName, strtolower('modelId'));
$auditEvent = new AuditEvent();
$auditEvent->dateTime = DateTimeUtil::convertTimestampToDbFormatDateTime(time());
$auditEvent->moduleName = $moduleName;
$auditEvent->eventName = $eventName;
$auditEvent->user = $user;
$auditEvent->modelClassName = $model !== null ? get_class($model) : null;
$auditEvent->modelId = $model !== null ? $model->id : null;
$auditEvent->serializedData = serialize($data);
$saved = $auditEvent->save();
AuditEvent::$isTableOptimized = true;
}
else
{
$sql = "insert into auditevent (datetime,
modulename,
eventname,
_user_id,
modelclassname,
modelid
)
values ('" . DateTimeUtil::convertTimestampToDbFormatDateTime(time()) . "',
'$moduleName',
'$eventName',
{$user->id}, " .
($model !== null ? "'" . get_class($model) . "', " : 'null, ') .
($model !== null ? "{$model->id}, " : 'null, ') .
":data)";
$saved = true;
}
return $saved;
}
#5
Posted 19 May 2012 - 11:18 PM
Jason Green
Zurmo Team
Need support? Upgrade now
#6
Posted 20 May 2012 - 03:59 PM
SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'serializeddata' at row 1
C:\inetpub\wwwroot\zurmo\redbean\rb.php(902)
890 $s->execute();
891 }
892 $this->affected_rows=$s->rowCount();
893 return $this->affected_rows;
894 }
895 catch(PDOException $e) {
#7
Posted 20 May 2012 - 06:21 PM
Jason Green
Zurmo Team
Need support? Upgrade now
#8
Posted 20 May 2012 - 06:25 PM
Jason Green
Zurmo Team
Need support? Upgrade now
#9
Posted 20 May 2012 - 06:28 PM
#10
Posted 20 May 2012 - 09:37 PM
# Set the SQL mode to strict sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
and yes AuditEvent is the first entry in getRootModelNames()
public function getRootModelNames() {
// ZurmoModule is a special case in that most of its models
// are non-root models of things that root models in the other
// modules, and because ZurmoModule is the root of the module
// dependence hierarchy it needed concern itself, other than
// with the models that are specific to itself.
return array('AuditEvent', 'NamedSecurableItem', 'GlobalMetadata', 'PerUserMetadata', 'Portlet', 'CustomFieldData',
'CalculatedDerivedAttributeMetadata', 'DropDownDependencyDerivedAttributeMetadata');
}
#11
Posted 21 May 2012 - 01:14 AM
If you can test manipulating the $modelClassNames array right in the beginning of the method, to have AuditEvent first, then let me know if it still breaks. We can go from there.
Actually now that I think about it, can you send the complete output as an attachment. I want to see where this error comes in the autobuild process. Is it in the beginning of the auto build process or later?
Jason Green
Zurmo Team
Need support? Upgrade now
#12
Posted 21 May 2012 - 10:22 AM
..............................
self::$uniqueStrings = array();
if (in_array('AuditEvent', $modelClassNames)) {
unset($modelClassNames[array_search('AuditEvent', $modelClassNames)]);
array_unshift($modelClassNames, "AuditEvent");
}
foreach ($modelClassNames as $modelClassName) {.................................
#13
Posted 21 May 2012 - 05:13 PM
https://www.pivotalt...y/show/29936051
http://hg.zurmo.org/...et/e05ae1e0ae94
Please let me know if it works ok, my fix.
Jason Green
Zurmo Team
Need support? Upgrade now
#15
Posted 21 May 2012 - 07:17 PM
Jason Green
Zurmo Team
Need support? Upgrade now
Also tagged with one or more of these keywords: auditevent, serializeddata, install, Bug
Zurmo Discussions →
Installation and Setup →
Install Language trough .PO FileStarted by quirogapj, 03 May 2013 |
|
|
||
Zurmo Discussions →
Installation and Setup →
Installation ErrorStarted by DrewUte, 30 Apr 2013 |
|
|
||
Zurmo Discussions →
Installation and Setup →
Install Hangs/Stops on GamePoint or GameScoreStarted by cob05, 19 Apr 2013 |
|
|
||
Zurmo Discussions →
User Questions →
Install Languages using finished translationsStarted by jackjamil, 16 Apr 2013 |
|
|
||
Zurmo Discussions →
Bug Reports →
Download page broke?Started by mledwards, 13 Mar 2013 |
|
|
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users










