contao / contao

Contao Open Source CMS
https://contao.org
GNU Lesser General Public License v3.0
352 stars 160 forks source link

Unable to generate a content URL for the SERP widget, please provide the url_callback #6860

Closed netzarbeiter closed 9 months ago

netzarbeiter commented 9 months ago

Affected version(s)

5.3.0-RC3

Description

If you want to reset the redirect target in a news item to "Use default", the following error occurs.

LogicException:
Unable to generate a content URL for the SERP widget, please provide the url_callback.

  at vendor/contao/core-bundle/contao/widgets/SerpPreview.php:171
  at Contao\SerpPreview->getUrl(object(NewsModel))
     (vendor/contao/core-bundle/contao/widgets/SerpPreview.php:53)
  at Contao\SerpPreview->generate()
     (vendor/contao/core-bundle/contao/library/Contao/Widget.php:647)
  at Contao\Widget->generateWithError(true)
     (vendor/contao/core-bundle/contao/templates/backend/be_widget.html5:3)
  at include('/home/…/public_html/…/vendor/contao/core-bundle/contao/templates/backend/be_widget.html5')
     (vendor/contao/core-bundle/contao/library/Contao/TemplateInheritance.php:109)
  at Contao\Widget->inherit()
     (vendor/contao/core-bundle/contao/library/Contao/Widget.php:595)
  at Contao\Widget->parse()
     (vendor/contao/core-bundle/contao/classes/DataContainer.php:777)
  at Contao\DataContainer->row()
     (vendor/contao/core-bundle/contao/drivers/DC_Table.php:2199)
  at Contao\DC_Table->edit()
     (vendor/contao/core-bundle/contao/classes/Backend.php:548)
  at Contao\Backend->getBackendModule('news', null)
     (vendor/contao/core-bundle/contao/controllers/BackendMain.php:146)
  at Contao\BackendMain->run()
     (vendor/contao/core-bundle/src/Controller/BackendController.php:44)
  at Contao\CoreBundle\Controller\BackendController->mainAction()
     (vendor/symfony/http-kernel/HttpKernel.php:181)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:76)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:197)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (public/index.php:44)
fritzmg commented 9 months ago

This would be fixed by https://github.com/contao/contao/pull/6854