sonata-project / sandbox

[Abandoned] Sonata Project's sandbox
https://sonata-project.org
MIT License
268 stars 198 forks source link

Clean sandbox installation - 500 Internal Server Error editing pages blocks (compose view) #488

Closed MeloAndroid closed 9 years ago

MeloAndroid commented 9 years ago

Hi,

EDIT: The error only occurs when accessing dev environment (whith app_dev.php), not in prod environment

I have a clean installation of the last sandbox at https://github.com/sonata-project/sandbox-build/archive/2.4.tar.gz. The installation and all the requirements was successful. The load_data.php script populate de database correctly and I can browse the content (frontend and admin backend) without errors.

In the admin dashboard, whe I try to edit the content of any page, I go to the page and to the Compose view, choose the section and the block to edit and always get the following internal server error in the ajax request that it does:

_Impossible to access an attribute ("options") on a boolean variable ("") in SonataAdminBundle:Form:form_admin_fields.html.twig at line 238 500 Internal Server Error - Twig_ErrorRuntime

The block editor is not loaded and can't edit pages.

I don't get this error with the same browser in the web demo. The apache log and the symfony log don't register anything else.

Thanks.

Tibase commented 9 years ago

Hello,

I have the same problem for a few days. I have not found the cause.

pixel-paul commented 9 years ago

The error is:

Impossible to access an attribute ('options') on a boolean variable ('') in 'SonataAdminBundle:Form:form_admin_fields.html.twig' at line 238 (500 Internal Server Error)

In file:

vendor/sonata-project/admin-bundle/Resources/views/Form/form_admin_fields.html.twig

Commenting out this line is a temporary workaround.

oversword commented 9 years ago

Instead of commenting it out, just catch it with an IF

Line 238; {% if sonata_admin.field_description.options is defined %} {% set label = sonata_admin.field_description.options.name|default(label) %} {% endif %}

This allows it to run if it won't error.

rande commented 9 years ago

Can someone provide a way to reproduce the error ? (ie, click here, and here....)

oversword commented 9 years ago

From a fresh Sonata 2.4 installation https://sonata-project.org/blog/2015/3/19/sonata-sandbox-build

Go-to Admin Menu > Pages > [edit page] > Composer > [choose block] > add block of type

Finally, choose a block type and hit the Add Button, this had been tested on Breadcrumb and Media by me personally and these seem to error.

The error is shown in the console as there is a 500 response from the ajax to this URL pattern /admin/app/page/5/block/create?composer=1&type=sonata.seo.block.breadcrumb.homepage

rande commented 9 years ago

It is working on my side ... I will try to update to build version.

screen shot 2015-04-27 at 15 46 48

rande commented 9 years ago

@oversword I have updated the build. You might give a new try.

oversword commented 9 years ago

@rande have just installed that, the error still occurs.

Just to clarify, I have installed again from the instructions at https://sonata-project.org/blog/2015/3/19/sonata-sandbox-build, this didn't work so I ran a composer update. This didn't work either.

Am I missing something? Should I be re-installing the admin bundle some other way?

rande commented 9 years ago

@oversword can you paste in a gist the output ?

oversword commented 9 years ago

https://gist.github.com/oversword/735c17728ae762d9bde0

ran : load data mkdir app/logs - cache load data curl composer phar composer update composer install - was just checking, it reverted the updates in the previous command composer update

rande commented 9 years ago

@oversword from the gist, the load_data.php script works. Why do you want to start composer ? the vendors are already there. Did you open a browser to check if the website was working ?

                                      __
               _________  ____  _____ / /______
              / ___/ __ \/ __ \/ __  / __/ __  /
             (__  ) /_/ / / / / /_/ / /_/ /_/ /
            /____/\____/_/ /_/\__,_/\__/\__,_/

Resetting demo, this can take a few minutes
WARNING, xdebug is enabled in the cli, this can drastically slowing down all PHP scripts
 - Checking Sonata Project's requirements................................OK
 - Deleting prod and dev cache folders...................................OK
 - Check for app/config/parameters.yml file..............................OK
 - Creating the class cache..............................................OK
 - Dropping the database.................................................OK
 - Creating the database.................................................OK
 - Creating the database's schema........................................OK
 - Loading fixtures......................................................OK
 - Sonata - News: updating comments count................................OK
 - Sonata - Page: updating core route....................................OK
 - Sonata - Page: creating snapshots from pages..........................OK
 - Configure assets......................................................OK
 - Security: setting up ACL..............................................OK
 - Security: generating object ACL.......................................OK

What's next ?!
 - Configure your webserver to point to the /var/www/sonata-test/sandbox/web folder.
 - Review the documentation: https://sonata-project.org/bundles
 - Follow us on twitter: https://twitter.com/sonataproject
oversword commented 9 years ago

Yes, I tested the site and found the error in question after load_data.php and after each composer.phar update/install. I assumed I just needed to install, but after this didn't work I thought perhaps you updated a particular bundle and not the entire installation, so I ran composer.

rande commented 9 years ago

@oversword there is one error with composer. However, the load_data.php works fine, so the demo should be working. We need to address the composer issue with missing .git file.

rande commented 9 years ago

@oversword the issue with composer update not working has been fixed.

rande commented 9 years ago

closing for now as there is no way to reproduce the issue with the last version.

ppetermann commented 9 years ago

uhm "the lastest version" being 2.3.x-dev? because in 2.4 the problem still exists (seems the fix has not been merged to master?)