Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Question about sonata_admin_doctrine_phpcr.tree_block root node #292

Closed
xleliberty opened this issue Aug 12, 2014 · 7 comments
Closed

Question about sonata_admin_doctrine_phpcr.tree_block root node #292

xleliberty opened this issue Aug 12, 2014 · 7 comments

Comments

@xleliberty
Copy link

Hi,

i'm trying to change default root node for the dashboard tree

but seems i can't...
I've tryed this config:

sonata_block:
blocks:
sonata_admin_doctrine_phpcr.tree_block:
settings:
id: '/my/other/root'

But, on the dashboard, tree is always started with "/" node

Any idea ?

Thanks

@dbu
Copy link
Contributor

dbu commented Aug 12, 2014

it could be that this is currently ignored - but that would be a bug.

can you debug this? the block service is at https://github.com/sonata-project/SonataDoctrinePhpcrAdminBundle/blob/master/Block/TreeBlockService.php

@xleliberty
Copy link
Author

Well,
I can see that option is passed ok into BlockContextManager
https://github.com/sonata-project/SonataBlockBundle/blob/master/Block/BlockContextManager.php#L120

But after that, the setting is overriden by the TreeBlockService default value and i don't really understand how to fix it...

In fact, removing the default id options in TreeBlockService does the trick but i doubt that it's the right way ?

/**
* {@inheritdoc}
*/
public function setDefaultSettings(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'template' => 'SonataDoctrinePHPCRAdminBundle:Block:tree.html.twig',
'selected' => null,
'routing_defaults' => $this->defaults,
));
}

thanks

@dbu
Copy link
Contributor

dbu commented Aug 19, 2014

this sounds weird. defaults should be overwritten by config, not hte other way round.

we recently had a bugfix about the ContainerBlock in CmfBlockBundle, maybe its a somewhat similar issue? i am not sure if its a bug here or in the sonata block bundle.

@dbu
Copy link
Contributor

dbu commented Aug 19, 2014

i found that i actually opened an issue here: sonata-project/SonataBlockBundle#149 - do you want to investigate?

@xleliberty
Copy link
Author

Hi David,
thank for taking time on this.
For now i've solved my problem by extending TreeBlockService in my own bundle but it's flaky...

I've just read the discussion mentioned in #149
I've no time in the 2 next weeks to work on that but i'll try to investigate during my next cmf run ;)

@dbu
Copy link
Contributor

dbu commented Sep 29, 2014

@xleliberty do you think your issue is the same as sonata-project/SonataBlockBundle#149? should we close this here?

@xleliberty
Copy link
Author

Yap, it smells like that . And pressed as a lemon by project deadlines, i didn't found time to investigate more.

Just close this one in favor of sonata-project/SonataBlockBundle#149 , i'll reopen if needed.

Xavier

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants