Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DamienMcKenna created an issue. See original summary.

mikeyk’s picture

@DamienMcKenna FYI I'm working on this now - should have a patch in a day or so for consideration

mikeyk’s picture

@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!

DamienMcKenna’s picture

The last submitted patch, 3: metatag-n2684479-3.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 4: metatag-n2684479-4.patch, failed testing.

The last submitted patch, 3: metatag-n2684479-3.patch, failed testing.

The last submitted patch, 4: metatag-n2684479-4.patch, failed testing.

DamienMcKenna’s picture

The translation test file was renamed, this fixes that.

mikeyk’s picture

Looks good!

DamienMcKenna’s picture

DamienMcKenna’s picture

Status: Needs review » Needs work

The last submitted patch, 11: metatag-n2684479-11.patch, failed testing.

The last submitted patch, 11: metatag-n2684479-11.patch, failed testing.

DamienMcKenna’s picture

This patch fixes a copy/paste error I made in #11, and sets the 'secure' attribute to 'TRUE' for og:image:secure_url. Because duh.

DamienMcKenna’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 15: metatag-n2684479-15.patch, failed testing.

The last submitted patch, 15: metatag-n2684479-15.patch, failed testing.

DamienMcKenna’s picture

The error is:

fail: [Fatal error] Line 0 of :
[14-May-2016 05:25:54 Australia/Sydney] Uncaught PHP Exception Drupal\Core\Config\Schema\SchemaIncompleteException: "Schema errors for metatag.metatag_defaults.global with the following errors: metatag.metatag_defaults.global:tags.og_image_secure_url missing schema, metatag.metatag_defaults.global:tags.og_image missing schema" at /var/www/html/core/lib/Drupal/Core/Config/Testing/ConfigSchemaChecker.php line 93

Any thoughts?

DamienMcKenna’s picture

I don't get that error when I manually save the admin/config/search/metatag/global form.

aspilicious’s picture

Not 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'

aspilicious’s picture

metatag.metatag_defaults.*:
  type: config_entity
  label: 'Metatag defaults'
  mapping:
    id:
      type: string
      label: 'ID'
    label:
      type: label
      label: 'Type'
    tags:
      type: sequence
      label: 'Tags'
      sequence:
        type: metatag.metatag_tag.[%key]

So each tag should be defined as "metatag.metatag_tag.[%key]".

The current og scheme is defined as:

metatag_open_graph.metatag_tag.og_image_secure_url:
  type: label
  label: 'Open Graph: Image secure URL'

I think replacing "metatag_open_graph" with "metatag" should do the trick

DamienMcKenna’s picture

AH! I thought those were supposed to be prefixed by the submodule's name, not metatag. Ok, that makes sense.

Lets see how this works.

  • DamienMcKenna committed 7dff907 on 8.x-1.x authored by mikeyk
    Issue #2684479 by mikeyk, DamienMcKenna, aspilicious: Added 'secure'...
DamienMcKenna’s picture

Status: Needs review » Fixed

That did the trick, thanks aspilicious!

aspilicious’s picture

You 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.