symfony-cmf/block-bundle

Setting 'valid_children' doesn't seem to be working

kminh opened this issue · 5 comments

Hi,

I'm using this in my configuration:

        Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\SimpleBlock:
            valid_children: []

As far as I understand this means SimpleBlock can not have any child, but still I can set even a ContainerBlock as its child. I can reproduce this with the CMF sandbox as well, is this expected?

(this might be an issue of SonataDoctrinePHPCRAdmin but I'm not sure, please feel free to close/move if needed)

Thanks.

dbu commented

this setting only affects the right-click "Create..." context menu on the tree in sonata admin. only valid cihldren will be offered in that context menu. it is not currently used for any sort of validation.

this is an issue of sonata admin, not of the block bundle. i think its already tracked as
sonata-project/SonataDoctrinePhpcrAdminBundle#61 - as you can see that issue is quite old. nobody so far got around to work on this. @wouterj is completely rebuilding the admin tree - maybe he has some input if you want to work on this?

This can be integrated in the new Sonata admin enhancer in the ResourceRestBundle. In fact, the complete tree backend from the SonataDoctrinePhpcrAdminBundle is going to be removed and replaced with ResourceRestBundle. This feature is not yet integrated in the Sonata admin enhancer.

dbu commented

i will add this comment to the sonata issue tracker. @kminh if you want to contribute, we would love it. otherwise please be patient, and watch that sonata issue for updates ;-)

No worry, I'm using Symfony CMF a lot so I want to post any issue I could find. Will wait patiently for updates.

Thanks @dbu and @wouterj .