According to Twitter, the following card types are deprecated:

Remove the options and provide an update script to convert existing values.

Issue fork metatag-3132062

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

DamienMcKenna created an issue. See original summary.

damienmckenna’s picture

damienmckenna’s picture

Status: Needs work » Active
damienmckenna’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
damienmckenna’s picture

Title: Remove Deprecated Twitter Card types (D8) » Remove deprecated Twitter Card types (D8)

igork96 made their first commit to this issue’s fork.

igork96’s picture

Status: Active » Needs review
StatusFileSize
new2.15 KB

Here is a patch for the request. Needs review.

Status: Needs review » Needs work

The last submitted patch, 8: remove_deprecated_twitter_cards-3132062-6.patch, failed testing. View results

damienmckenna’s picture

Title: Remove deprecated Twitter Card types (D8) » Deprecate Twitter Card plugins
Parent issue: » #3313052: Plan for Metatag 8.x-1.23

The first step is to mark the plugins "deprecated", then remove the files. Because we have two issues for this, we'll deprecate them in this issue in Metatag v1 and then remove them in #3132065: Remove deprecated Twitter Card plugins (D9) in Metatag v2.

damienmckenna’s picture

Title: Deprecate Twitter Card plugins » Remove deprecated Twitter Card types (D8)

Ignoring #10, refocusing this on just removing the expired card type values.

damienmckenna’s picture

Status: Needs work » Needs review
Related issues: +#3132065: Remove deprecated Twitter Card plugins (D9)

And now with an update script, the logic of which was borrowed from #3132065: Remove deprecated Twitter Card plugins (D9) so it should be ok.

damienmckenna’s picture

StatusFileSize
new9.39 KB
damienmckenna’s picture

Version: 8.x-1.x-dev » 2.0.x-dev
Assigned: Unassigned » damienmckenna
Status: Needs review » Needs work
Parent issue: #3313052: Plan for Metatag 8.x-1.23 » #3272774: Plan for Metatag 2.0.0

I'm moving this to v2 so that I can take advantage of the existing testing structure.

  • DamienMcKenna committed 3448842c on 8.x-1.x
    Issue #3132062 by DamienMcKenna: Updated fixtures with Twitter Cards...

  • DamienMcKenna committed 86e52c46 on 2.0.x
    Issue #3132062 by DamienMcKenna: Updated fixtures with Twitter Cards...
damienmckenna’s picture

WIP that builds on #3336234.

damienmckenna’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 17: metatag-n3132062-15.patch, failed testing. View results

  • DamienMcKenna committed b680e95d on 8.x-1.x
    Issue #3132062 by DamienMcKenna: Updated fixtures with some...

  • DamienMcKenna committed 0675ca7c on 2.0.x
    Issue #3132062 by DamienMcKenna: Updated fixtures with some...
damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new11.3 KB

More work, and documentation.

  • DamienMcKenna committed a5e9b827 on 2.0.x
    Issue #3132062 by DamienMcKenna, igork96: Remove deprecated Twitter Card...
damienmckenna’s picture

Status: Needs review » Fixed

Committed. Thanks for your contribution, igork96!

renatog’s picture

Assigned: damienmckenna » Unassigned
Status: Fixed » Needs work
+++ b/metatag.post_update.php
@@ -475,6 +484,17 @@ function metatag_post_update_v2_02_remove_entity_values(array &$sandbox) {
+      if (isset($tags['twitter_cards_type'])) {
+        foreach ($twitter_type_changes as $type_from => $type_to) {
+          if ($tags['twitter_cards_type'] == $type_from) {
+            $tags['twitter_cards_type'] = $type_to;
+            $changed = TRUE;
+            break;
+          }
+        }
+      }

I think we can improve this logic to use "early return" on this condition, right?

Example:

foreach ($twitter_type_changes as $type_from => $type_to) {
  if ($tags['twitter_cards_type'] != $type_from) {
    continue;
  }
  $tags['twitter_cards_type'] = $type_to;
  $changed = TRUE;
  break;
}
renatog’s picture

Status: Needs work » Needs review
StatusFileSize
new807 bytes

Patch with one example

damienmckenna’s picture

Status: Needs review » Fixed

Thank you. Committed.

Status: Fixed » Closed (fixed)

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