Problem/Motivation

Argument $entity is declared as '@param string $entity' in SchemaMetatagManagerInterface.php but uses in the code as object:

  // SchemaMetatagManager.php
  public static function getRenderedJsonld($entity = NULL, $entity_type = NULL) {
    // If nothing was passed in, assume the current entity.
    // @see schema_metatag_entity_load() to understand why this works.
    if (empty($entity)) {
      $entity_type = $entity->entity_type;  //line 102
      $entity = menu_get_object($entity_type);
    }
  ...

Proposed resolution

Propose to change declaration of argument $entity to '@param object $entity'.

Comments

Igumnov_aleksey created an issue. See original summary.

Igumnov_aleksey’s picture

StatusFileSize
new500 bytes
damienmckenna’s picture

Status: Needs work » Needs review

Thank you for spotting this, for reporting the bug and providing a patch.

I think we should also change the function arguments, but in the interest of not breaking API compatibility, we'll leave it as-is for now.

damienmckenna’s picture

thejimbirch’s picture

Status: Needs review » Closed (won't fix)

Closing this issue as Drupal 7 is no longer supported.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.