I am using Drupal 10. Metatag module works fine with php 8.1 Changing to php 8.2 produces the following error message:
Deprecated function: Use of "static" in callables is deprecated in Drupal\schema_metatag\Plugin\metatag\Tag\SchemaNameBase->output() (line 148 of modules/contrib/schema_metatag/src/Plugin/metatag/Tag/SchemaNameBase.php).
Deprecated function: Use of "static" in callables is deprecated in Drupal\schema_metatag\Plugin\metatag\Tag\SchemaNameBase->output() (line 148 of modules/contrib/schema_metatag/src/Plugin/metatag/Tag/SchemaNameBase.php).
Deprecated function: Use of "static" in callables is deprecated in Drupal\schema_metatag\Plugin\metatag\Tag\SchemaNameBase->output() (line 148 of modules/contrib/schema_metatag/src/Plugin/metatag/Tag/SchemaNameBase.php).
Deprecated function: Use of "static" in callables is deprecated in Drupal\schema_metatag\Plugin\metatag\Tag\SchemaNameBase->output() (line 148 of modules/contrib/schema_metatag/src/Plugin/metatag/Tag/SchemaNameBase.php).
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | Screenshot 2023-03-02 at 4.14.38 PM.png | 62.2 KB | ankitv18 |
| #3 | schema_metatag-fix-deprecation-warning-3340957-3.patch | 587 bytes | ewout goosmann |
Comments
Comment #2
damienmckennaThis is a bug in Schema.org Metatag, rather than the Metatag module itself; moving the issue over.
Comment #3
ewout goosmannThis patch should solve the deprecation warning about using "static" in callables.
See https://php.watch/versions/8.2/partially-supported-callable-deprecation
Comment #4
damienmckennaThanks for the patch. Let's see what the tests say.
Comment #5
ankitv18 commentedComment #6
ankitv18 commentedHi,
Patch#3 applied successfully and I've tested with PHP 8.2 and Drupal 10.0.4.
Didn't notice any errors related to this on UI.
Moving to RTBC
Comment #7
damienmckennaThank you for the review; please don't upload screenshots that show a patch applies, that's useless noise in the issue queue.
Comment #10
damienmckennaCommitted. Thank you.
Comment #13
rajeshreeputra@DamienMcKenna this is released in 3.0.0 but not in 2.4, when it will be availble?
Comment #14
apotek commented> @DamienMcKenna this is released in 3.0.0 but not in 2.4, when it will be availble?
@Rajeshreeputra I would recommend opening a new issue asking for this patch to be backported to the recommended release version.
Comment #15
damienmckennaThis fix was release in 8.x-2.5, just update the module to have the fix available in your codebase.