Zend Framework

adding action to controller messes up existing functions

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Critical Critical
  • Resolution: Duplicate
  • Affects Version/s: 1.10.6, 1.10.7
  • Fix Version/s: None
  • Component/s: Zend_Tool
  • Labels:
    None

Description

When you add an action to a controller that already has data in it, the closing curly brace before the function's closing on each function gets removed and the functions get some strange new indentation on everything but the first line.

I've been bitten by this a few times and thought it was fixed by now. I also thought I reported this before, but I can't see a bug report for it.

Issue Links

Activity

Hide
Martin Hujer added a comment -

Steps to reproduce the issue:

> zf create project test

> Changed IndexController - indexAction to:

<?php

class IndexController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        if ($this->getRequest()->isPost()) {
            //something
            if ($form->isValid($_POST)) {
                //something
            }
        }
    }

}

> cd test
> zf create action foo

And the IndexController looks this way:

<?php

class IndexController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        if ($this->getRequest()->isPost()) {
                    //something
                    if ($form->isValid($_POST)) {
                        //something
                    }
    }

    public function fooAction()
    {
        // action body
    }


}
Show
Martin Hujer added a comment - Steps to reproduce the issue: > zf create project test > Changed IndexController - indexAction to:
<?php

class IndexController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        if ($this->getRequest()->isPost()) {
            //something
            if ($form->isValid($_POST)) {
                //something
            }
        }
    }

}
> cd test > zf create action foo And the IndexController looks this way:
<?php

class IndexController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        if ($this->getRequest()->isPost()) {
                    //something
                    if ($form->isValid($_POST)) {
                        //something
                    }
    }

    public function fooAction()
    {
        // action body
    }


}
Hide
Martin Hujer added a comment -

still broken in 1.10.7

Show
Martin Hujer added a comment - still broken in 1.10.7
Hide
Ramon Henrique Ornelas added a comment -

This problem is related to Zend_Reflection_Method::getBody().
See issue ZF-9018.

Greetings
Ramon

Show
Ramon Henrique Ornelas added a comment - This problem is related to Zend_Reflection_Method::getBody(). See issue ZF-9018. Greetings Ramon
Hide
Ramon Henrique Ornelas added a comment -

Issue duplicated of ZF-9501

Show
Ramon Henrique Ornelas added a comment - Issue duplicated of ZF-9501
Hide
Marc Hodgins added a comment -

Removing fix version. Issues marked 'duplicate' don't need a fix version – it makes them appear in the JIRA changelog and/or roadmap.

Show
Marc Hodgins added a comment - Removing fix version. Issues marked 'duplicate' don't need a fix version – it makes them appear in the JIRA changelog and/or roadmap.

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: