Error:
Error: Call to a member function getDefinitionMatch() on null in Drupal\micon\MiconIconize->getMatch() (line 218 of /home/sites/lastD8/web/modules/contrib/micon/src/MiconIconize.php)
quick workaround:
on "micon/src/MiconIconize.php" (line 218)
change
if ($icon_id = $this->miconDiscoveryManager->getDefinitionMatch($prefix . $string)) {
to
if (method_exists($this->miconDiscoveryManager, 'getDefinitionMatch') && $icon_id = $this->miconDiscoveryManager->getDefinitionMatch($prefix . $string)) {
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 3172262-3.patch | 620 bytes | grevil |
| #2 | 3172262-2.patch | 622 bytes | karishmaamin |
Comments
Comment #2
karishmaamin commentedHere is the patch
Comment #3
suresh prabhu parkala commentedComment #4
jacobbell84 commentedI'm not able to reproduce this, can you provide more details on your setup? What Drupal version you're on, which Micon modules you're using, etc. Thanks.
Comment #5
steveoriolSome infos juste after install module on D9.1.2 :
drush wsThe patch #2 works...
Comment #6
anybodyDoes this still occur with 2.x? Otherwise we should set this outdated.
Comment #7
grevil commentedI could not reproduce the error on login for 2.x.
Although, the "$miconDiscoveryManager" class annotation was declared as a "\Drupal\micon\MiconIconManager" instead of "\Drupal\micon\MiconDiscoveryManager". I created a small patch with this fix and another tiny variable type doc fix.
Furthermore, patch #2 is quite dirty. As the main problem was, that "$this->miconDiscoveryManager" seems to not have been properly initialized, so it was NULL. Leading to method_exists(NULL, 'getDefinitionMatch'), which never resolves to be true.
Setting this to outdated.
Comment #8
grevil commented