Hello, when using PUTTY and entering the command Drush Rebuilt, the display is as follows

Fatal error: Declaration of Drupal\schema_metatag\SchemaMetatagManager::pivot($c ontent) must be compatible with Drupal\schema_metatag\SchemaMetatagManagerInterf ace::pivot(array $content) in /home/xxxx/public_html/xxxx/modules /schema_metatag/src/SchemaMetatagManager.php on line 12

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jattura created an issue. See original summary.

Jattura’s picture

Issue summary: View changes
mightyulysses’s picture

I had the same issue. Until a fix is rolled out, I managed to fix it locally and get my site running by editing the offending function declarations in SchemaMetatagManagerInterface.php in src folder as below. I'm not a coder or a maintainer of this module so I'm not suggesting this is the ideal fix - just wanted to get my site running again until a proper fix is rolled out. 🙂

Line 72 public static function pivot($content);

Line 83 public static function countNumericKeys($item);

Line 140 public static function arrayTrim($array);

Line 156 public static function isObject($array);

Line 170 public static function serialize($value);

Grayle’s picture

HEAD of dev seems to have fixes for these issues, afaict. Dev does still have another problem, though. Calling $this in a static method. That I can patch, at least.

Webbeh’s picture

Component: Miscellaneous » Code
Assigned: Jattura » Unassigned
Status: Active » Needs review

Does the work in #4 solve this issue, for the combination of `dev` branch and the supplied patch?

Marking Needs Review to confirm this, given the Priority on this issue.

Jattura’s picture

Thank you for your efforts. Grayle, However, after applying the patch, the result did not change. This is strange.

Grayle’s picture

Did you check out the latest dev release and apply the patch to that? If I do that, I don't have any errors, but I won't be able to properly test that until tomorrow.

Grayle’s picture

Status: Needs review » Reviewed & tested by the community

I tried a full option reinstall of my install profile, which gives this fatal with the latest release. With HEAD of dev + this patch the site successfully installs.

KarenS’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
1.23 KB

I would fix this differently.

Grayle’s picture

That's a possible BC break, though.

KarenS’s picture

I seriously doubt any custom code is using that function, even in this module it's only used in one very specific way. We've already changed numerous other static methods to non-static so if anything was depending on them we've already broken them. This one function was just missed.

KarenS’s picture

And all the static to non-static changes were to get SchemaMetatagManager using dependency injection so the service can be overridden.

KarenS’s picture

I'm going to agree about not changing the static method. I'll issue a new release after this change is in, then I'm going to move to a new branch where I have a number of changes to make. I found a much cleaner way to organize this code.

  • KarenS committed 7d5df4a on 8.x-1.x authored by Grayle
    Issue #3168072 by Grayle: Fatal error: Declaration of Drupal\...
KarenS’s picture

Status: Needs review » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

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