Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem
After fixing the profile view router on https://www.drupal.org/node/2659474 I got this error:
LogicException: You are not allowed to use drupal_add_html_head_link in #attached. in Drupal\Core\Render\HtmlResponseAttachmentsProcessor->processAttachments() (line 150 of /var/www/phto/core/lib/Drupal/Core/Render/HtmlResponseAttachmentsProcessor.php).
It seems there is a problem on ProfileViewController::view
on $build['#attached']
Comment | File | Size | Author |
---|---|---|---|
#2 | profile-fix-view-controller-2659510-2.patch | 1.07 KB | gremy |
Comments
Comment #2
gremy CreditAttribution: gremy as a volunteer commentedFixed
$build['#attached'
] onProfileViewController::view
Comment #3
gremy CreditAttribution: gremy as a volunteer commentedComment #4
mariancalinro CreditAttribution: mariancalinro as a volunteer commentedPatch tested manually, it fixes the error on the profile page.
Comment #5
dakalaIt works but I think just changing the array key from 'drupal_add_html_head_link' to 'html_head_link' would suffice here. The short array square bracket syntax, [] doesn't have to be changed to array().
Comment #6
mglamanLet's put this back to short array syntax.
Comment #8
mglamanI just made the change and committed. Thanks for patch!