Pimcore 5 Admin Interface

whenever I try to create a new controller, I get the following error ( on File Create). After this, I can not reload the Admin Interface):

Server threw exception - could not perform action. Please reload the admin interface and try again.

Timestamp: Mon Oct 09 2017 11:10:30 GMT-0400 (Eastern Daylight Time)
Status: 500 | Internal Server Error
URL: /admin/misc/fileexplorer-tree?_dc=1507561830114
Method: GET
Message:
body { background-color: #F9F9F9; color: #222; font: 14px/1.4 Helvetica, Arial, sans-serif; margin: 0; padding-bottom: 45px; }

        a { cursor: pointer; text-decoration: none; }
        a:hover { text-decoration: underline; }
        abbr[title] { border-bottom: none; cursor: help; text-decoration: none; }

        code, pre { font: 13px/1.5 Consolas, Monaco, Menlo, "Ubuntu Mono", "Liberation Mono", monospace; }

        table, tr, th, td { background: #FFF; border-collapse: collapse; vertical-align: top; }
        table { background: #FFF; border: 1px solid #E0E0E0; box-shadow: 0px 0px 1px rgba(128, 128, 128, .2); margin: 1em 0; width: 100%; }
        table th, table td { border: solid #E0E0E0; border-width: 1px 0; padding: 8px 10px; }
        table th { background-color: #E0E0E0; font-weight: bold; text-align: left; }

        .hidden-xs-down { display: none; }
        .block { display: block; }
        .break-long-words { -ms-word-break: break-all; word-break: break-all; word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; }
        .text-muted { color: #999; }

        .container { max-width: 1024px; margin: 0 auto; padding: 0 15px; }
        .container::after { content: ""; display: table; clear: both; }

        .exception-summary { background: #B0413E; border-bottom: 2px solid rgba(0, 0, 0, 0.1); border-top: 1px solid rgba(0, 0, 0, .3); flex: 0 0 auto; margin-bottom: 30px; }

        .exception-message-wrapper { display: flex; align-items: center; min-height: 70px; }
        .exception-message { flex-grow: 1; padding: 30px 0; }
        .exception-message, .exception-message a { color: #FFF; font-size: 21px; font-weight: 400; margin: 0; }
        .exception-message.long { font-size: 18px; }
        .exception-message a { border-bottom: 1px solid rgba(255, 255, 255, 0.5); font-size: inherit; text-decoration: none; }
        .exception-message a:hover { border-bottom-color: #ffffff; }

        .exception-illustration { flex-basis: 111px; flex-shrink: 0; height: 66px; margin-left: 15px; opacity: .7; }

        .trace + .trace { margin-top: 30px; }
        .trace-head .trace-class { color: #222; font-size: 18px; font-weight: bold; line-height: 1.3; margin: 0; position: relative; }

        .trace-message { font-size: 14px; font-weight: normal; margin: .5em 0 0; }

        .trace-file-path, .trace-file-path a { color: #222; margin-top: 3px; font-size: 13px; }
        .trace-class { color: #B0413E; }
        .trace-type { padding: 0 2px; }
        .trace-method { color: #B0413E; font-weight: bold; }
        .trace-arguments { color: #777; font-weight: normal; padding-left: 2px; }

        @media (min-width: 575px) {
            .hidden-xs-down { display: initial; }
        }
                       Whoops, looks like something went wrong.

                                    (1/1)
                                    RuntimeException
                                
                                The autoloader expected class "AppBundle\Controller\AdvancedController" to be defined in file "/var/local/xxxx/www_xxxx_coop/vendor/composer/../../src/AppBundle/Controller/AdvancedController.php". The file was found but the class was not in it, the class name or namespace probably has a typo.
                            
                            in DebugClassLoader.php (line 263)

at DebugClassLoader->loadClass(‘AppBundle\Controller\AdvancedController’)
at spl_autoload_call(‘AppBundle\Controller\AdvancedController’)
at class_exists(‘AppBundle\Controller\AdvancedController’)in ClassExistenceResource.php (line 78)
at ClassExistenceResource->isFresh(0)in ContainerBuilder.php (line 361)
at ContainerBuilder->getReflectionClass(‘AppBundle\Controller\AdvancedController’)in FileLoader.php (line 132)
at FileLoader->findClasses(‘AppBundle\Controller\’, ‘…/…/Controller’, null)in FileLoader.php (line 61)
at FileLoader->registerClasses(object(Definition), ‘AppBundle\Controller\’, ‘…/…/Controller’, null)in YamlFileLoader.php (line 532)
at YamlFileLoader->parseDefinition(‘AppBundle\Controller\’, array(‘resource’ => ‘…/…/Controller’, ‘public’ => true, ‘tags’ => array(‘controller.service_arguments’)), ‘/var/local/xxxx/www_xxxx_coop/src/AppBundle/DependencyInjection/…/Resources/config/services.yml’, array(‘autowire’ => true, ‘autoconfigure’ => true))in YamlFileLoader.php (line 227)
at YamlFileLoader->parseDefinitions(array(‘services’ => array(‘AppBundle\Controller’ => array(‘resource’ => ‘…/…/Controller’, ‘public’ => true, ‘tags’ => array(‘controller.service_arguments’)))), ‘/var/local/xxxx/www_xxxx_coop/src/AppBundle/DependencyInjection/…/Resources/config/services.yml’)in YamlFileLoader.php (line 139)
at YamlFileLoader->load(‘services.yml’)in AppExtension.php (line 28)
at AppExtension->load(array(array()), object(ContainerBuilder))in MergeExtensionConfigurationPass.php (line 66)
at MergeExtensionConfigurationPass->process(object(ContainerBuilder))in MergeExtensionConfigurationPass.php (line 39)
at MergeExtensionConfigurationPass->process(object(ContainerBuilder))in Compiler.php (line 143)
at Compiler->compile(object(ContainerBuilder))in ContainerBuilder.php (line 746)
at ContainerBuilder->compile()in Kernel.php (line 577)
at Kernel->initializeContainer()in Kernel.php (line 124)
at Kernel->boot()in kernel.php (line 25)
at require_once(’/var/local/xxxx/www_xxxx_coop/pimcore/config/kernel.php’)in app.php (line 50)

You are not creating the controller properly:

The autoloader expected class "AppBundle\Controller\AdvancedController" to be defined in file "/var/local/xxxx/www_xxxx_coop/vendor/composer/../../src/AppBundle/Controller/AdvancedController.php".

Either your namespace or classname are not correct.

Post your controller code and we might find out what is the problem.

Cheers, Igor

@IgorBenko faster again :smiley:

Your class should look like this:

<?php
namespace AppBundle\Controller;

class AdvancedController extends \Pimcore\Controller\FrontendController
{
    
}

Where should the project development be done ? In Pimcore 4 all the development was done under /website folder.
Pimcore 5 Documentation show the :
controller in /src/AppBundle/Controller folder.
views : /app/Resources/views folder
static content in /web/static folder

Is that correct ?

here is the controller:

<?php
namespace AppBundle\Controller;
use AppBundle\Form\ContactFormType;
use AppBundle\Form\PersonInquiryType;
use Pimcore\Controller\FrontendController;

class AdvancedController extends FrontendController
{
    public function indexAction()
    {
        $list = new Document\Listing();
        $list->setCondition("parentId = ? AND type IN ('link','page')", [$this->document->getId()]);
        $list->load();

        $this->view->documents = $list;
    }
}

yeah, thats correct

cheers
dominik

I am a little confused … looking at the documentation:
https://pimcore.com/docs/5.0.x/Getting_Started/Directory_Structure.html
The web/ Directory
"It is also the place where each front controller (the file that handles all requests to your application) lives, such as the production controller"

It seems to suggest the Controllers should go under /web folder

1 Like

Hi,

thats right as well. The index.php is considered to be called a controller as well, cause it handles the initial request and gives it to Pimcore/Symfony.

See here for more: https://symfony.com/doc/current/introduction/from_flat_php_to_symfony2.html

Regards

Hi, All!

I create file /var/www/html/pimstart/pimstart/src/AppBundle/Controller/TestController.php

And I get the error:

What is wrong with my DNA?