Closed rabauss closed 2 years ago
This listener isn't intended for the DI container, so I think it would be better to skip it in the service definition. WDYT?
It's only used here as far as I see: https://github.com/heimrichhannot/contao-google-maps-bundle/blob/62b5a1c3e12b457e0c49aa05d3e7efc4f0ed2809/src/Manager/MapManager.php#L183
Yes, this could be also a solution - but I was not sure if it was intended to initalize the MapRendererListener
as service!
I don't wrote this part of code, but I don't think that this was intended, so I would prefer the "skip-way", as it looks cleaner to me.
I realized that I was missing the third param of renderMapObject
in a custom implementation with the MapManager
.
So the $templateData['mapConfigModel']
was not set and caused the error with the MapRendererListener
.
We can close this PR - although I think an exclude in the services.yml
would not be wrong:
//src/Resources/config/services.yml
HeimrichHannot\GoogleMapsBundle\:
resource: '../../{EventListener,EventSubscriber}/*'
exclude: '../../EventListener/MapRendererListener.php'
I've skipped the service in 9e27d3a
Thanks anyway @rabauss !
The model can be null on automatic initation via DI - so the type should be also nullable