Closed (fixed)
Project:
Metatag
Version:
8.x-1.x-dev
Component:
Integration with other module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Jun 2020 at 16:07 UTC
Updated:
24 Aug 2020 at 15:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
alexpottHere's a patch which shows the problem.
Comment #3
alexpottI can't run a test with DrupalCI against 8.x-1.10 but here's the output:
Comment #5
alexpottAfter spending sometime in the debugger I can see where the implementation of metatag_test_integration_page_attachments_alter() is incorrect. It's expecting
$attachments['#attached']['html_head']to still have a title attribute. Since #3099168: Remove "title" meta tag, leave the regular title tag it no longer does. So the code doesn't work as expected. If we change it as per the patch attached here - everything seems to work.Perhaps this is better implemented as hook_metatags_attachments_alter() in the first place.
Comment #7
mrinalini9 commentedFixing test case failure issue in #5, please review.
Comment #8
alexpott@mrinalini9 that fix looks important for the metatag module. This issue was created to explore modules that implement hook_page_attachments_alter() and change metatag related stuff. You could check the metatag issue queue and if there is not an issue already you could file an issue to correct #7.
Comment #9
alexpottThis will fail tests because HEAD metatag is failing tests due to #7. But that should be fixed in another issue.
Comment #10
alexpottReading
metatag_preprocess_html()again I think we need to be clearer about whose attachments we are reading from. In $variables there's$variables['#attached']and$variables['html_attributes']and $attributes looks like the same variable as it is inmetatag_page_attachments().I think we should copy the approach from
metatag_page_attachments()and call them$metatag_attachmentsComment #13
alexpottChanging the hook implementation to the correct
hook_metatags_attachments_alter()so now the module has test coverage of this hook.Comment #14
alexpottAnd finally lets tidy up the test.
Comment #17
damienmckennaThe tests have been fixed in the 8.x-1.x branch, back to fixing this.
Comment #18
alexpottThis should pass now...
Comment #19
damienmckennaNice work, thank you! Committed.