Closed
Description
Preconditions
- Magento 2
Steps to reproduce
- Create a custom module with following controller:
use Magento\Framework\View\Result\PageFactory;
class SomeAction extends \Magento\Framework\App\Action\Action
{
/**
* @var PageFactory
*/
protected $resultPageFactory;
public function __construct(
Context $context,
PageFactory $resultPageFactory
) {
parent::__construct($context);
$this->resultPageFactory = $resultPageFactory;
}
public function execute()
{
/** $resultPage @var \Magento\Framework\View\Result\Page */
$resultPage = $this->resultPageFactory->create();
$resultPage->getConfig()->setMetadata('title', 'some meta title');
return $resultPage;
}
}
- Open the created controller on storefront.
Expected result
Page is opened, its source contains <meta name="title" content="some meta title">
Actulal result
Error message: "Recoverable Error: Object of class Magento\Framework\View\Page\Title could not be converted to string..."
Additional info: the reason in that page config renderer tries to use page title object as meta title content (in \Magento\Framework\View\Page\Config\Renderer::processMetadataContent()).
Metadata
Metadata
Assignees
Labels
The issue has been fixed in 2.1 release lineThe issue has been fixed in 2.2 release lineThe issue has been fixed in 2.3 release lineGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Failed. Automatic verification of issue format is failedGate 4. Acknowledged. Issue is added to backlog and ready for developmentThe issue has been reproduced on latest 2.1 releaseThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.3 release