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.
Port the feature from the D7 branch that allows indication that a meta tag should be secure, which would just replace all occurrences of "http://" with "https://".
Comment | File | Size | Author |
---|---|---|---|
#23 | metatag-n2684479-23.patch | 53.65 KB | DamienMcKenna |
Comments
Comment #2
mikeyk CreditAttribution: mikeyk commented@DamienMcKenna FYI I'm working on this now - should have a patch in a day or so for consideration
Comment #3
mikeyk CreditAttribution: mikeyk commented@DamienMcKenna Attached is a patch to add this functionality. It adds a new attribute to MetaNameBase called "secure". If a tag has this set to TRUE (currently only og:image:secure_url), then any http:// will be converted to https://. Also included is a test.
Hopefully I've gone about this the way you had anticipated!
Comment #4
DamienMcKennaOh, awesome! Thank you! This has just a few minor tweaks.
Comment #9
DamienMcKennaThe translation test file was renamed, this fixes that.
Comment #10
mikeyk CreditAttribution: mikeyk commentedLooks good!
Comment #11
DamienMcKennaRerolled.
Comment #12
DamienMcKennaComment #15
DamienMcKennaThis patch fixes a copy/paste error I made in #11, and sets the 'secure' attribute to 'TRUE' for og:image:secure_url. Because duh.
Comment #16
DamienMcKennaComment #19
DamienMcKennaThe error is:
Any thoughts?
Comment #20
DamienMcKennaI don't get that error when I manually save the admin/config/search/metatag/global form.
Comment #21
aspilicious CreditAttribution: aspilicious commentedNot yet found the root cause, but I noticed this already:
metatag_open_graph.metatag_tag.og_image:
type: label
label: 'Open Graph: Image height'
metatag_open_graph.metatag_tag.og_image:
type: label
label: 'Open Graph: Image'
Comment #22
aspilicious CreditAttribution: aspilicious commentedSo each tag should be defined as "metatag.metatag_tag.[%key]".
The current og scheme is defined as:
I think replacing "metatag_open_graph" with "metatag" should do the trick
Comment #23
DamienMcKennaAH! I thought those were supposed to be prefixed by the submodule's name, not metatag. Ok, that makes sense.
Lets see how this works.
Comment #25
DamienMcKennaThat did the trick, thanks aspilicious!
Comment #26
aspilicious CreditAttribution: aspilicious commentedYou still have a duplicate key:
-metatag_open_graph.metatag_tag.og_image:
+metatag.metatag_tag.og_image:
type: label
label: 'Open Graph: Image height'
-metatag_open_graph.metatag_tag.og_image:
+metatag.metatag_tag.og_image:
type: label
label: 'Open Graph: Image'
The fact that the test doesn't fail means that "image height" is never used in the UI or that there isn't any test saving og image height.