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

Comments

Kulturmensch created an issue. See original summary.

damienmckenna’s picture

Project: Metatag » Schema.org Metatag
Version: 8.x-1.22 » 3.0.x-dev
Issue tags: -Deprecated function +PHP 8.2

This is a bug in Schema.org Metatag, rather than the Metatag module itself; moving the issue over.

ewout goosmann’s picture

This patch should solve the deprecation warning about using "static" in callables.

See https://php.watch/versions/8.2/partially-supported-callable-deprecation

damienmckenna’s picture

Status: Active » Needs review

Thanks for the patch. Let's see what the tests say.

ankitv18’s picture

Assigned: Unassigned » ankitv18
ankitv18’s picture

Assigned: ankitv18 » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new62.2 KB

Hi,
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

damienmckenna’s picture

Thank you for the review; please don't upload screenshots that show a patch applies, that's useless noise in the issue queue.

damienmckenna’s picture

Status: Reviewed & tested by the community » Fixed
Parent issue: » #3325544: Plan for schema.org Metatag 8.x-1.10

Committed. Thank you.

Status: Fixed » Closed (fixed)

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

rajeshreeputra’s picture

@DamienMcKenna this is released in 3.0.0 but not in 2.4, when it will be availble?

apotek’s picture

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

damienmckenna’s picture

This fix was release in 8.x-2.5, just update the module to have the fix available in your codebase.