sonata-project / sandbox

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

500 error when Compose page "Home" #417

Closed oonxt closed 9 years ago

oonxt commented 10 years ago

7481ef92-326a-44a6-b702-32c7a5226efe

url:admin/sonata/page/page/compose/container/20 msg: Key "sonata.page.block.container" for array with keys "sonata.page.block.children_pages, sonata.page.block.breadcrumb, sonata.news.block.recent_posts, sonata.news.block.recent_comments, sonata.media.block.media, sonata.media.block.feature_media, sonata.media.block.gallery, sonata.customer.block.recent_customers, sonata.order.block.recent_orders, sonata.product.block.recent_products, sonata.product.block.similar_products, sonata.product.block.categories_menu, sonata.product.block.filters_menu, sonata.product.block.variations_form, sonata.formatter.block.formatter, sonata.block.service.text, sonata.block.service.rss, sonata.block.service.menu, sonata.block.service.template, sonata.seo.block.email.share_button, sonata.seo.block.facebook.like_box, sonata.seo.block.facebook.like_button, sonata.seo.block.facebook.send_button, sonata.seo.block.facebook.share_button, sonata.seo.block.twitter.share_button, sonata.seo.block.twitter.follow_button, sonata.seo.block.twitter.hashtag_button, sonata.seo.block.twitter.mention_button, sonata.seo.block.twitter.embed, sonata.seo.block.pinterest.pin_button, sonata.seo.block.breadcrumb.homepage, sonata.demo.block.newsletter" does not exist in SonataPageBundle:PageAdmin:compose_container_show.html.twig at line 30

castor831 commented 9 years ago

Any news? I got the same error.

hunslater commented 9 years ago

where: vendor/sonata-project/block-bundle/Block/BlockServiceManager.php

function: getServicesByContext

this is my hack:

https://gist.github.com/hunslater/14065fbf5ac59cee3ec2

rande commented 9 years ago

How did you get this error ? from the sonata's sandbox ?

It is not possible to have a container inside a container. So something is wrong with either your data or the sandbox's fixtures.

hunslater commented 9 years ago

https://github.com/sonata-project/sandbox/blob/2.3/src/Sonata/Bundle/DemoBundle/DataFixtures/ORM/LoadPageData.php#L1108

Example:

If you wish to edit the "global" page from the admin composer view

finchen commented 9 years ago

I have the same problem. The sandbox has a container within a container and it works fine Header > Menu Container > Menu

My project has the same error. As hunslater mentions, it seems to come from BlockServiceManager ->getServicesByContext($context, $includeContainers = true)

either the arguments $includeContainers or the list of containers $this->container->getParameter('sonata.block.container.types') is different between the demo and my project.

i hope to find out why soon and let you know

rande commented 9 years ago

this has been fixed.

milokmet commented 9 years ago

I've installed latest 2.4-develop sandbox and I have the same issue too :-(

OskarStark commented 9 years ago

@milokmet can you please have a look on this bug and maybe create a PR if you'll get this fixed?

Would be awesome :+1:

Thank you

milokmet commented 9 years ago

@OskarStark But the demo.sonata-project.org is not affected, so i think there is already some hidden fix. At least I can try to find it myself :-)

OskarStark commented 9 years ago

:+1:

milokmet commented 9 years ago

I was not successful figuring out what's wrong, but I found, that it is working in prod environment but not dev. The demo.sonata-project.org is affected as well.

OskarStark commented 9 years ago

ping @rande

thank you for the feedback @milokmet

netfarma commented 8 years ago

I have the same issue with sandbox, when edit page with id 1 (Compose page "global")

Block with name "The header container" (sonata.page.block.container) has two children "header-top" and "The header menu container" (also sonata.page.block.container).

@finchen solution works perfect.