Skip to content

Commit

Permalink
Making unit test happy. The default xml string needs a '0' for the ro…
Browse files Browse the repository at this point in the history
…wNumbers
  • Loading branch information
pkamps committed Aug 15, 2020
1 parent d2968ff commit 2ebaf40
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kernel/classes/datatypes/ezmatrix/ezmatrixtype.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $o
else
{
$contentClassAttribute = $contentObjectAttribute->contentClassAttribute();
$numRows = $contentClassAttribute->attribute( 'data_int1' );
$numRows = (int)$contentClassAttribute->attribute( 'data_int1' );
$matrix = new eZMatrix( '', $numRows, $contentClassAttribute->attribute( 'content' ) );
// 'default name' is never used => just a stub
// $matrix->setName( $contentClassAttribute->attribute( 'data_text1' ) );
Expand Down Expand Up @@ -436,7 +436,7 @@ function serializeContentClassAttribute( $classAttribute, $attributeNode, $attri
if ( $content )
{
$defaultName = $classAttribute->attribute( 'data_text1' );
$defaultRowCount = $classAttribute->attribute( 'data_int1' );
$defaultRowCount = (int)$classAttribute->attribute( 'data_int1' );
$columns = $content->attribute( 'columns' );

$dom = $attributeParametersNode->ownerDocument;
Expand Down Expand Up @@ -465,7 +465,7 @@ function unserializeContentClassAttribute( $classAttribute, $attributeNode, $att
$defaultName = $attributeParametersNode->getElementsByTagName( 'default-name' )->item( 0 )->textContent;
$defaultRowCount = $attributeParametersNode->getElementsByTagName( 'default-row-count' )->item( 0 )->textContent;
$classAttribute->setAttribute( 'data_text1', $defaultName );
$classAttribute->setAttribute( 'data_int1', $defaultRowCount );
$classAttribute->setAttribute( 'data_int1', (int)$defaultRowCount );

$matrixDefinition = new eZMatrixDefinition();
$columnsNode = $attributeParametersNode->getElementsByTagName( 'columns' )->item( 0 );
Expand Down Expand Up @@ -506,7 +506,7 @@ function supportsBatchInitializeObjectAttribute()

function batchInitializeObjectAttributeData( $classAttribute )
{
$numRows = $classAttribute->attribute( 'data_int1' );
$numRows = (int)$classAttribute->attribute( 'data_int1' );
$matrix = new eZMatrix( '', $numRows, $classAttribute->attribute( 'content' ) );
$db = eZDB::instance();
return array( 'data_text' => "'" . $db->escapeString( $matrix->xmlString() ) . "'" );
Expand Down

0 comments on commit 2ebaf40

Please sign in to comment.