Skip to content

Assumption Mage::app()->getFrontController() is set #85

Open
@ajbonner

Description

@ajbonner

I run a lot of unit tests which do not cause the frontcontroller to be inited/dispatched. These tests break when certain events require design & layout be loaded.

https://github.com/zendesk/magento_extension/blob/master/src/app/code/community/Zendesk/Zendesk/Model/Observer.php#L23

The above referenced code runs when layouts are loaded and it looks to the front controller to determine an active handle/route path.

This assumes that Mage_Core_Model_App::run() is called, which is only necessary if you are dispatching an http request. Shell scripts, cron jobs, unit tests for example, may have some need to load layout but not run a full request->response cycle.

I think the easiest solution here would be simply to do an if check on the frontController being an instance of Mage_Core_Controller_Varien_Front before trying to access the getActionName var.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions