Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

missing function #277

Open
featureless opened this issue Sep 14, 2017 · 3 comments
Open

missing function #277

featureless opened this issue Sep 14, 2017 · 3 comments

Comments

@featureless
Copy link

The 'exists' function is missing in the PhpcrBlockLoader class to use sonata_block_exists in twig template

@dbu
Copy link
Member

dbu commented Sep 18, 2017

then that function is not defined by the Sonata\BlockBundle\Block\BlockLoaderInterface interface? is there an additional interface to implement? or does sonata check with a method_exists? or just hope a method happens to be there even though the interface does not require it?

either way, if you want to do a pull request to do the necessary changes, i am happy to review and merge that.

@featureless
Copy link
Author

When I use 'sonata_block_exists' in twig template I have this error:

request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\UndefinedMethodException: "Attempted to call an undefined method named "exists" of class "Symfony\Cmf\Bundle\BlockBundle\Block\PhpcrBlockLoader"." at C:\projets\vendor\sonata-project\block-bundle\Block\BlockLoaderChain.php line 41 {"exception":"[object] (Symfony\Component\Debug\Exception\UndefinedMethodException(code: 0): Attempted to call an undefined method named "exists" of class "Symfony\Cmf\Bundle\BlockBundle\Block\PhpcrBlockLoader". at C:\projets\vendor\sonata-project\block-bundle\Block\BlockLoaderChain.php:41)"} []

@dbu
Copy link
Member

dbu commented Sep 25, 2017

seems like sonata_block_exists does not check the interfaces well, it should check if that method exists. as said, i am happy to review a pull request if you want to add the exists method and figure out how that method is supposed to be defined, if we should implement an interface.

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