This topic contains 3 replies, has 2 voices, and was last updated by Rodolfo 9 years, 3 months ago.
- Topic
Hi Oro Friends,
Please a I need a help to extend this method: https://github.com/orocrm/platform/blob/master/src/Oro/Bundle/UserBundle/Controller/UserController.php#L177-L197
I tried using ‘$output = parent::view();’ but didn’t work. So I decided to try copying all the logic from the original method.
So, what am I doing wrong?123456789101112131415161718192021222324252627282930313233343536<?phpnamespace Acme\Bundle\TestBundle\Controller;use Oro\Bundle\UserBundle\Controller\UserController as BaseController;class UserController extends BaseController{/*** @param User $entity* @param string $editRoute* @return array*/protected function view(User $entity, $editRoute = ''){$output = array('entity' => $entity,// TODO: it is a temporary solution. In a future it is planned to give an user a choose what to do:// completely delete an owner and related entities or reassign related entities to another owner before'allow_delete' =>$this->getUser()->getId() !== $entity->getId() &&!$this->get('oro_organization.owner_deletion_manager')->hasAssignments($entity));if ($editRoute) {$output = array_merge($output, array('editRoute' => $editRoute));}$foo = 'bar';$output = array_merge($output, array('foo' => $foo));return $output;}}My error is:
Strict standards: Declaration of Acme\Bundle\TestBundle\Controller\UserController::view() should be compatible with Oro\Bundle\UserBundle\Controller\UserController::view(Oro\Bundle\UserBundle\Entity\User $entity, $editRoute = ”) in /www/orocrm/src/Acme/Bundle/TestBundle/Controller/UserController.php on line 8And
Unable to generate a URL for the named route “oro_user_security_login” as such route does not exist.
500 Internal Server Error – RouteNotFoundExceptionThanks guys!
The forum ‘OroPlatform’ is closed to new topics and replies.