-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Unable to render page when 'meta title' page config param is set #2956
Comments
Not sure if I would expect that |
The problem is that we cannot set meta title of page using \Magento\Framework\View\Page\Config::setMetadata(): <meta name="title" content="Page title"> It's not related to page title: <title>Page title</title> We can set any other meta data, but not 'meta title' because during processing of meta data content magento invokes getter method of \Magento\Framework\View\Page\Config, which for 'title' data will be \Magento\Framework\View\Page\Config::getTitle(), which returns \Magento\Framework\View\Page\Title object, that is not converted to string. |
Correct way to setup title was specified by @xhallix $resultPage->getConfig()->getTitle()->set("FOO"); But current behavior looks like issue. Setting metadata should have the same result for any meta name. Created ticket MAGETWO-47807 |
any news about MAGETWO-47807? |
@volnnn, thank you for your report. |
magento#2956 Fixed. Added a check to to see if returned content is object or not. As objects will never be converted to string and will throw error for str_replace at line 125
Hi @volnnn. Thank you for your report.
The fix will be available with the upcoming 2.3.0 release. |
Hi @volnnn. Thank you for your report.
The fix will be available with the upcoming 2.1.15 release. |
[TSG] Backporting for 2.2 (pr37) (2.2.7)
Preconditions
Steps to reproduce
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()).
The text was updated successfully, but these errors were encountered: