Zend Framework

Problems with arrays

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.10.5
  • Fix Version/s: 1.10.6
  • Component/s: Zend_Locale
  • Labels:
    None

Description

After updating from 1.10.4 to 1.10.5 i got a php warning:

Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /opt/zf/1.10.5/Zend/Locale.php on line 812

Line 812 is:

|| (is_array($locale) && array_key_exists($locale, self::$_localeData))

But $locale may not be an array for array_key_exists(). So I guess, just a ! is missing:

|| (!is_array($locale) && array_key_exists($locale, self::$_localeData))

Activity

Hide
Dolf Schimmel (Freeaqingme) added a comment -

How can one reproduce the issue?

Show
Dolf Schimmel (Freeaqingme) added a comment - How can one reproduce the issue?
Hide
Sandra Schneider added a comment -

I got this error while calling:

<?php echo $this->translate("translation string", $someArray); ?>

$someArray is an array with two elements, 'cause the translation in my po-file has two placeholders.

Show
Sandra Schneider added a comment - I got this error while calling:
<?php echo $this->translate("translation string", $someArray); ?>
$someArray is an array with two elements, 'cause the translation in my po-file has two placeholders.
Hide
Thomas Weidner added a comment -

Is $this->translate an object of Zend_Translate?
Or is $this a view helper?

Because Zend_Translate does not support view operations and the second parameter for Zend_Translate is the language and not a placeholder.

Show
Thomas Weidner added a comment - Is $this->translate an object of Zend_Translate? Or is $this a view helper? Because Zend_Translate does not support view operations and the second parameter for Zend_Translate is the language and not a placeholder.
Hide
Sandra Schneider added a comment -

$this is an instance of Zend_View.
So $this->translate() calls the view helper.

Show
Sandra Schneider added a comment - $this is an instance of Zend_View. So $this->translate() calls the view helper.
Hide
Thomas Weidner added a comment -

Not reproduceable for me, wether in trunk nor in branch.
Probably already fixed in past.

Show
Thomas Weidner added a comment - Not reproduceable for me, wether in trunk nor in branch. Probably already fixed in past.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: