Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New "Element Group" element in News and Events: Field tl_content.pid does not seem to be related #7187

Closed
CMSworker opened this issue May 4, 2024 · 1 comment

Comments

@CMSworker
Copy link
Contributor

Affected version(s)

5.3.7

Description

The error occured in my case with the "change language" extension installed (and was reported there), but I think maybe it is a problem in the Contao core, because there was already a similar problem a few years ago, caused by a loop and resolved by @ausi : #5014

Maybe the nesting functionality of the new "element group" elements is causing another loop in the Contao\Model->getRelated('pid') function?

Steps to reproduce:

  • Contao 5.3.7 with NewsBundle and ChangeLanguage 3.6.5 installed
  • Add a news archive
  • Add a new news article
  • Add a Element Group element (that was introduced with Contao 5.3)
  • Try to edit the children of the Element Group -> error: "Field tl_content.pid does not seem to be related"

Stack trace:

Exception:
Field tl_content.pid does not seem to be related

  at [...]\vendor\contao\core-bundle\contao\library\Contao\Model.php:685
  at Contao\Model->getRelated('pid')
     ([...]\vendor\terminal42\contao-changelanguage\src\EventListener\BackendView\ParentChildViewListener.php:55)
  at Terminal42\ChangeLanguage\EventListener\BackendView\ParentChildViewListener->getCurrentPage()
     ([...]\vendor\terminal42\contao-changelanguage\src\EventListener\BackendView\AbstractViewListener.php:63)
  at Terminal42\ChangeLanguage\EventListener\BackendView\AbstractViewListener->onLoad(object(DC_Table))
     ([...]\vendor\terminal42\contao-changelanguage\src\EventListener\BackendView\AbstractViewListener.php:35)
  at Terminal42\ChangeLanguage\EventListener\BackendView\AbstractViewListener->Terminal42\ChangeLanguage\EventListener\BackendView\{closure}(object(DC_Table))
     ([...]\vendor\contao\core-bundle\contao\drivers\DC_Table.php:227)
  at Contao\DC_Table->__construct('tl_content', array('tables' => array('tl_news_archive', 'tl_news', 'tl_content'), 'table' => array('Contao\\CoreBundle\\Controller\\BackendCsvImportController', 'importTableWizardAction'), 'list' => array('Contao\\CoreBundle\\Controller\\BackendCsvImportController', 'importListWizardAction')))
     ([...]\vendor\contao\core-bundle\contao\classes\Backend.php:291)
  at Contao\Backend->getBackendModule('news', null)
     ([...]\vendor\contao\core-bundle\contao\controllers\BackendMain.php:144)
  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))
     ([...]\web\index.php:42)

Related:
terminal42/contao-changelanguage#245
terminal42/contao-changelanguage#247

@CMSworker CMSworker changed the title New "Element Group" element: Field tl_(news|calendar_events).pid does not seem to be related New "Element Group" element in News and Events: Field tl_content.pid does not seem to be related May 27, 2024
@CMSworker
Copy link
Contributor Author

This issue seems to be solved with the latest updates in the change_language extension.
Thank you @aschempp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant