- Issue created by @stayr
- Status changed to Needs review
2 months ago 12:33pm 18 July 2024 Hi @stayr,
You received this error due to a type hint mismatch. The error occurs when the type of the argument being passed to the constructor does not match the expected type. I reviewed your code and identified that you need to add some lines to the 'services.yml' file.
Please refer to the attached patch for details.
Thanks!
After patch error
Error: Call to a member function getAccount() on null in Drupal\user_ref_field_cache_context\CacheContext\UserReferenceField->getContext() (line 60 of modules/contrib/user_ref_field_cache_context/src/CacheContext/UserReferenceField.php).
After patch error
Error: Call to a member function getAccount() on null in Drupal\user_ref_field_cache_context\CacheContext\UserReferenceField->getContext() (line 60 of modules/contrib/user_ref_field_cache_context/src/CacheContext/UserReferenceField.php).
- Status changed to Active
2 months ago 12:48pm 18 July 2024 After patch error
Error: Call to a member function getAccount() on null in Drupal\user_ref_field_cache_context\CacheContext\UserReferenceField->getContext() (line 60 of modules/contrib/user_ref_field_cache_context/src/CacheContext/UserReferenceField.php).
- Status changed to Needs review
2 months ago 12:48pm 18 July 2024 After patch error
Error: Call to a member function getAccount() on null in Drupal\user_ref_field_cache_context\CacheContext\UserReferenceField->getContext() (line 60 of modules/contrib/user_ref_field_cache_context/src/CacheContext/UserReferenceField.php).
After patch error
Error: Call to a member function getAccount() on null in Drupal\user_ref_field_cache_context\CacheContext\UserReferenceField->getContext() (line 60 of modules/contrib/user_ref_field_cache_context/src/CacheContext/UserReferenceField.php).
- Status changed to Active
2 months ago 12:51pm 18 July 2024 After patch error
Error: Call to a member function getAccount() on null in Drupal\user_ref_field_cache_context\CacheContext\UserReferenceField->getContext() (line 60 of modules/contrib/user_ref_field_cache_context/src/CacheContext/UserReferenceField.php).
- Assigned to stayr
Error after path
Error: Call to a member function getAccount() on null in Drupal\user_ref_field_cache_context\CacheContext\UserReferenceField->getContext() (line 60 of modules/contrib/user_ref_field_cache_context/src/CacheContext/UserReferenceField.php).
Error after path
Error: Call to a member function getAccount() on null in Drupal\user_ref_field_cache_context\CacheContext\UserReferenceField->getContext() (line 60 of modules/contrib/user_ref_field_cache_context/src/CacheContext/UserReferenceField.php).