There have been two issues recently (#2267501: Replace twitter:image with twitter:image:src, #2121437: Change from "Copyright" to "Rights" per w3c/whatwg metatag guidelines) where a meta tag was renamed. While it's simple to do an update script to update values in the {metatag} table, that does not resolve the problem that exported configurations will loose their existing values, i.e. the configurations for the old old meta tags will disappear. I suggest adding something like a 'replaces' value to the meta tag definition, which would ben an array containing the names of meta tags that were replaced by the current tag, so if settings for the old values were found they would be used as values for the new meta tag instead.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | metatag-n2298337-3.patch | 5.73 KB | damienmckenna |
Comments
Comment #1
damienmckennaNeeds testing, but the general idea is that a tag defined via hook_metatag_info() would have an attribute named 'replaces' which would list either a single or multiple meta tags it would take the value of. Both the {metatag} and {metatag_config} items will be handled, which will hopefully make this relatively seamless. I've not tested this out yet, it's basically a prototype.
Comment #2
damienmckennaAfter some testing, this appears to work rather nicely.
Comment #3
damienmckennaThis patch adds documentation for hook_metatag_info to metatag.api.php, which includes an explanation of the new 'replaces' value.
Comment #4
damienmckennaI've committed this.