Closed (fixed)
Project:
More Global Variables
Version:
2.1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Jul 2022 at 11:03 UTC
Updated:
2 Apr 2026 at 09:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #5
bserem commentedComment #6
bserem commentedAlso takes care of this deprecation error too:
Comment #7
bserem commentedComment #8
bserem commentedSo, the problem was elsewhere, I missed it at first but the problem comes from https://git.drupalcode.org/project/mgv/-/blob/2.1.x/src/Plugin/GlobalVar... which returns null.
Comment #9
bserem commentedComment #10
bserem commentedSo, I'm digging deeper on this. None of the
SocialSharingEmail, SocialSharingFaceboo, SocialSharingLinkedIn, SocialSharingTwitterwork properly. regardless if their tests pass.I am on PHP 8.1, haven't tested with anything else. In all the above 4 classes, the
Url::fromUridoesn't get it's parameters populated from$this->getDependencyComment #11
bserem commentedSo, these lines: https://git.drupalcode.org/project/mgv/-/blob/2.1.x/src/Plugin/GlobalVar...
always return an empty array and that's causing the problems.
Comment #12
kybermanHi, I found the problem was the plugin construction phase (plugin definition was not used).
The attached patch solves the error and fills the variables with correct values.
Could you please review it? Thank you.
Btw, tests don't look to be correct, so it would be great to fix them.
Comment #14
kybermanHere is an attempt to fix tests.
Comment #15
kybermanAnd here we are - tests are fixed and passing. Could someone review it?
Comment #19
volegerthanks, fixed