Zend Framework

_getParam second parameter no longer working when used in conjunction with routes

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.10.8
  • Component/s: Zend_Controller
  • Labels:
    None

Description

Ever since we upgraded to ZF 1.9.7, _getParam no longer replaces "empty" values with the second parameter. This is related to ZF-5163.

When a route has been defined as follows:

$route = new Zend_Controller_Router_Route( ':lang/:controller/:action/*',
                array('controller'=>'index',
                    'action' => 'index',
                    'module'=>'default',
                    'lang'=>'en'));

and the user types a URL like "http://myapp.example.com//examplecontroller/exampleaction",

  • _getParam('lang') returns an empty string instead of null
  • _getParam('lang','en') now returns an empty string. Prior to ZF 1.9.7, it returns 'en', which is the expected result.

Since our application relies on routes, upgrading to 1.9.7 broke several major modules.

Activity

Hide
Tomáš Fejfar added a comment -

Still not fixed in 1.10.5...

Show
Tomáš Fejfar added a comment - Still not fixed in 1.10.5...
Hide
Martin Hujer added a comment -

Attaching patch.

Show
Martin Hujer added a comment - Attaching patch.
Hide
Matthew Weier O'Phinney added a comment -

Patch applied in trunk and 1.10 release branch.

Show
Matthew Weier O'Phinney added a comment - Patch applied in trunk and 1.10 release branch.

People

Vote (2)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: