Author: Tobias Schlitt
Date: 2007-05-06 16:59:56 +0200 (Sun, 06 May 2007)
New Revision: 5075

Log:
- Fixed issue #10710: ezcConsoleTable reports fatal error on example
  $table[][0]->content = "foo".

Modified:
   trunk/ConsoleTools/ChangeLog
   trunk/ConsoleTools/src/table.php
   trunk/ConsoleTools/tests/table_test.php

Modified: trunk/ConsoleTools/ChangeLog
===================================================================
--- trunk/ConsoleTools/ChangeLog        2007-05-06 14:58:50 UTC (rev 5074)
+++ trunk/ConsoleTools/ChangeLog        2007-05-06 14:59:56 UTC (rev 5075)
@@ -21,6 +21,8 @@
   broken.
 - Fixed issue #10626: ezcConsoleStatusbar does not trigger warning on invalid
   status.
+- Fixed issue #10710: ezcConsoleTable reports fatal error on example
+  $table[][0]->content = "foo".
 - Implemented issue #8461: Argument help text. A completely new argument
   handling was invented.
 - Implemented issue #9216: ezcConsoleInput::getOptionValues I want long names.

Modified: trunk/ConsoleTools/src/table.php
===================================================================
--- trunk/ConsoleTools/src/table.php    2007-05-06 14:58:50 UTC (rev 5074)
+++ trunk/ConsoleTools/src/table.php    2007-05-06 14:59:56 UTC (rev 5075)
@@ -278,6 +278,7 @@
      */
     public function offsetGet( $offset )
     {
+        $offset = ( $offset === null ) ? count( $this->rows ) : $offset;
         if ( !is_int( $offset ) || $offset < 0  )
         {
             throw new ezcBaseValueException( 'offset', $offset, 'int >= 0 or 
null' );

Modified: trunk/ConsoleTools/tests/table_test.php
===================================================================
--- trunk/ConsoleTools/tests/table_test.php     2007-05-06 14:58:50 UTC (rev 
5074)
+++ trunk/ConsoleTools/tests/table_test.php     2007-05-06 14:59:56 UTC (rev 
5075)
@@ -706,6 +706,8 @@
         $table[0] = new ezcConsoleTableRow();
 
         $this->assertEquals( new ezcConsoleTableRow(), $table[0] );
+        // Test for bug #10710
+        $this->assertEquals( "test", ( $table[][0]->format = "test" ) );
     }
 
     public function testOffsetGetFailure()

-- 
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to