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.
I didn't realise or forgot that the maintenance page isn't run through html.tpl.php so it's missing the mobile friendly meta tags. What's the best way to get these in?
Comment | File | Size | Author |
---|---|---|---|
#29 | 1887800-29-installer-mobile-meta.patch | 4.73 KB | JohnAlbin |
#27 | 1887800-27-installer-test.patch | 23.74 KB | JohnAlbin |
#21 | 1887800-21-installer-tests.patch | 24.02 KB | JohnAlbin |
#20 | 1887800-20-installer-mobile-meta-tags.patch | 5.81 KB | JohnAlbin |
#15 | mobile-friendly-meta-tags-maintenance-1887800-15.patch | 2.85 KB | rteijeiro |
Comments
Comment #1
LewisNymanSee: #1468582: Add mobile friendly meta tags to the html.tpl.php
Comment #2
DamienMcKennaShouldn't there also be a tag for "meta tags"?
Comment #3
rteijeiro CreditAttribution: rteijeiro commentedI copied the same solution from the
template_preprocess_html
in thecore/includes/theme.inc
file and it seems to work.Let me know what do you think :)
Comment #4
LewisNymanCan we make this code a little bit less repetitive? Maybe have a meta tags function we call to add them in? I did that in #1337554: Develop and use separate branding for the installer but we should add it here really
Comment #5
rteijeiro CreditAttribution: rteijeiro commentedAbsolutely, I will do it today when I have some time. Thanks!!
Comment #6
LewisNymanI've added the mobile meta tags function from #1337554: Develop and use separate branding for the installer
Comment #8
rteijeiro CreditAttribution: rteijeiro commentedI completely forgot about this issue. Tested and the patch applies well so let see what says the Testbot again and RTBC ;)
Comment #9
rteijeiro CreditAttribution: rteijeiro commented#6: mobile-friendly-meta-tags-maintenance-1887800-6.patch queued for re-testing.
Comment #10
rteijeiro CreditAttribution: rteijeiro commentedIt seems RTBC.
Comment #11
alexpottNow that we can test the interactive installer we should add a test to check that these tags are added.
You should be able to assert that the headers are there in the setUp method of \Drupal\system\Tests\InstallerTest
Comment #12
rteijeiro CreditAttribution: rteijeiro commentedTest created but not sure if it's correct. Feel free to blame on me :)
Comment #14
rteijeiro CreditAttribution: rteijeiro commentedAnother try copied from:
DefaultMobileMetaTagsTestCase
test incore/modules/system/system.test
file.I don't know why it gives me an error when I add a new test case in the
InstallerTest.php
. I there is only one test case, it works correctly. Maybe other people can help me with this issue because I don't have enough experience with PHP Unit testing :(Comment #15
rteijeiro CreditAttribution: rteijeiro commentedOk, now #6 patch and the test.
Comment #16
LewisNymanComment #18
JohnAlbinThe patch in #6 doesn't work. That might explain why the tests fail in #15.
Lewis, you are calling a "_theme_mobile_meta_tags" function twice, but never define it.
Also, this issue is a bug, not a task. The CSS is designed to work on small screens, but the lack of metatags means that mobile devices will fake a much larger desktop-sized viewport.
Comment #19
JohnAlbinI was going to live demo the installer in an iPhone tomorrow, but can't until I fix this bug.
@Lewis, Oh! I take it back. I see how that function is defined. Sneaky little patch. :-)
I'm going to try to get this patch to green.
Comment #20
JohnAlbinI don't like the _theme_mobile_meta_tags() function name. I've renamed it to drupal_add_mobile_meta_tags(), which… sucks less.
And here's a test that actually works. It was tricky to write. Copied chunks from both DefaultMobileMetaTagsTest and from InstallerTranslationTest.
Comment #21
JohnAlbinHere's a new patch that refactors a lot of the underlying plumbing. It makes the meta tag test much smaller. But I'm fairly certain it causes several warnings, but maybe no failures. Needs work, but let's let the testbot have a go.
Comment #23
LewisNymanRelated: #1717090: Remove the http-equiv="cleartype" meta tag
Comment #24
LewisNymanIf we are going to refactor this code it might also be worth thinking about the @viewport CSS rule, it triggers the same behaviour.
Comment #25
LewisNyman#21: 1887800-21-installer-tests.patch queued for re-testing.
Comment #27
JohnAlbinRe-rolled patch for MWDS show-and-tell. Should still fail.
Comment #28
JohnAlbinI'm going to move the installer test refactoring to a new issue, make this issue a dependency on this one. Also, I'll need to take a look at Lewis' latest suggestion.
Comment #29
JohnAlbinThe refactoring of the installer tests has moved to: #2067919: Refactor installer tests so they don't have to override Setup().
Here's the rerolled patch with the simple tests that require that other issue.
Comment #30
LewisNymanComment #31
jenlamptonI think this isn't necessary anymore, so marking as closed. Please re-open if I'm wrong.