fnagel / t3extblog

A record based blog extension for TYPO3 CMS. Easy to use and packed with features (incl. comments, subscriptions for comments and posts, Wordpress like subscription manager, reasonable email sending in FE and BE, GDPR ready, BE modules, Dashboard widgets, RSS, Sitemap, ...). Flexible and powerful!
http://typo3.org/extensions/repository/view/t3extblog
GNU General Public License v2.0
33 stars 19 forks source link

Render inline extbase plugin #189

Closed dablach closed 6 years ago

dablach commented 6 years ago

When rendering inline content elements that are Extbase plugins, the framework configuration gets lost (overwritten). In my case, a dce element was rendered, which resultet in a persistence.storagePid of 0. Because of that the number of comments (queried in Post::initComments) was always zero (list action).

I could fix this by storing and restoring the framework configuration in ViewHelpers\Frontend\RenderContentViewHelper like that (around line 111):

$configurationManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class)->get(\TYPO3\CMS\Extbase\Configuration\ConfigurationManager::class);
$frameworkConfiguration = $configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);

$html = $this->getContentObjectRenderer()->cObjGetSingle('RECORDS', $configuration);

$configurationManager->setConfiguration($frameworkConfiguration);
fnagel commented 6 years ago

Please add info as described in https://github.com/fnagel/t3extblog/blob/master/CONTRIBUTING.md Please add info about used DCE version as well.

This seems not to be true for extbase plugins in general but for EXT:dce (and other?) as I'm running multiple extbase plugins within the t3extblog CEs without issues.

The renderRecord method is taken from VHS. Would you mind testing if this issue occues when using their VH too? Would be helpful for a better understanding what might be the issue here.

See https://github.com/FluidTYPO3/vhs/blob/development/Classes/ViewHelpers/Content/AbstractContentViewHelper.php

fnagel commented 6 years ago

Any feedback on this issue?

fnagel commented 6 years ago

Any feedback on this issue?

fnagel commented 6 years ago

Closed as no feedback was given. Please reopen or create a new ticket if needed.