Image block error

Permalink
Hello.

Just recently upgraded our site to 8.5.2 and now we are getting an error whenever we try and add or edit an Image Block.

The destination picker with handle "none" is not registered.
Details
/Applications/MAMP/htdocs/concrete/src/Form/Service/DestinationPicker/DestinationPicker.php(261): RuntimeException->null   
/Applications/MAMP/htdocs/concrete/src/Form/Service/DestinationPicker/DestinationPicker.php(137): Concrete\Core\Form\Service\DestinationPicker\DestinationPicker->getHandlesWithOptions   
/Applications/MAMP/htdocs/concrete/blocks/image/form.php(44): Concrete\Core\Form\Service\DestinationPicker\DestinationPicker->generate   
/Applications/MAMP/htdocs/concrete/src/Block/View/BlockView.php(361): null->include   
/Applications/MAMP/htdocs/concrete/blocks/image/add.php(2): Concrete\Core\Block\View\BlockView->inc   
/Applications/MAMP/htdocs/concrete/src/Block/View/BlockView.php(248): null->include   
/Applications/MAMP/htdocs/concrete/src/View/AbstractView.php(164): Concrete\Core\Block\View\BlockView->renderViewContents   
/Applications/MAMP/htdocs/concrete/views/dialogs/page/add_block.php(102): Concrete\Core\View\AbstractView->render   
/Applications/MAMP/htdocs/concrete/src/View/View.php(267): null->include   
/Applications/MAMP/htdocs/concrete/src/View/View.php(245): Concrete\Core\View\View->renderInnerContents   
/Applications/MAMP/htdocs/concrete/src/View/AbstractView.php(164): Concrete\Core\View\View->renderViewContents   
/Applications/MAMP/htdocs/concrete/src/Routing/ControllerRouteAction.php(82): Concrete\Core\View\AbstractView->render   
/Applications/MAMP/htdocs/concrete/src/Http/RouteDispatcher.php(37): Concrete\Core\Routing\ControllerRouteAction->execute


When I debug concrete/blocks/image/form.php, the $imageLinkPickers array includes:
'none','page,'file' and $imageLinkHandle is 'none'.

$destinationPicker->generate(
                'imageLink',
                $imageLinkPickers,
                $imageLinkHandle,
                $imageLinkValue
            )


Drilling down deeper it eventually reaches
concrete/src/Form/Service/DestinationPicker/DestinationPicker.php where $handle is 'none'

public function getPicker($handle)
    {
        return isset($this->registeredPickers[$handle]) ? $this->registeredPickers[$handle] : null;
    }


and $this->registeredPickers[] is empty.

Where do the Pickers get Registered?

Later...

Just discovered the answer, thanks to Mesuva, who pointed it out to me.

We had Form overrides in Applications/src/Concrete/Form/CustomFormServiceProvider.php but hadn't checked the new 8.5.2 Applications/src/Concrete/Form/FormServiceProvider.php
which had added the following:
$this->app->bind(DestinationPicker\DestinationPicker::class, function (Application $app) {
            return $app->build(DestinationPicker\DestinationPicker::class)
                ->registerPickers([
                    'none' => $app->make(DestinationPicker\NoDestinationPicker::class),
                    'page' => $app->make(DestinationPicker\PagePicker::class),
                    'file' => $app->make(DestinationPicker\FilePicker::class),
                    'external_url' => $app->make(DestinationPicker\ExternalUrlPicker::class),
                    'email' => $app->make(DestinationPicker\EmailPicker::class),
                ])
            ;
        });


So that's where the Pickers are Registered?

Big 'shout out' to Ryan!

tangent
 
ConcreteOwl replied on at Permalink Best Answer Reply
ConcreteOwl
Just posting the answer for those who need it.
Extracted from the above post...
###
Just discovered the answer, thanks to Mesuva, who pointed it out to me.

We had Form overrides in Applications/src/Concrete/Form/CustomFormServiceProvider.php but hadn't checked the new 8.5.2 Applications/src/Concrete/Form/FormServiceProvider.php
which had added the following:
$this->app->bind(DestinationPicker\DestinationPicker::class, function (Application $app) {
            return $app->build(DestinationPicker\DestinationPicker::class)
                ->registerPickers([
                    'none' => $app->make(DestinationPicker\NoDestinationPicker::class),
                    'page' => $app->make(DestinationPicker\PagePicker::class),
                    'file' => $app->make(DestinationPicker\FilePicker::class),
                    'external_url' => $app->make(DestinationPicker\ExternalUrlPicker::class),
                    'email' => $app->make(DestinationPicker\EmailPicker::class),
                ])
            ;
        });


So that's where the Pickers are Registered?

Big 'shout out' to Ryan!