- Merge request !155Issue #2769303: add a service method to get all of a user's flagged entities for a given flag → (Merged) created by ivnish
Hallo,
as I see with the latest dev update the function getFlaggings get replaced with getEntityFlaggings.
But previously I was able to call this function without an entity. Now I cannot accomplish this anymore.
previously:
$flag = \Drupal::service('flag')->getFlagById('following');
$user = \Drupal::currentUser();
$following = \Drupal::service('flag')->getFlaggings($flag, NULL, $user);
If I call now:
$flag = \Drupal::service('flag')->getFlagById('following');
$user = \Drupal::currentUser();
$following = \Drupal::service('flag')->getEntityFlaggings($flag, NULL, $user);
I get:
Recoverable fatal error: Argument 2 passed to Drupal\flag\FlagService::getEntityFlaggings() must implement interface Drupal\Core\Entity\EntityInterface, null given
Probably it's just my lack of knowlege, is there an easy way to create an empty instance of Entity for passing?
The logic of getEntityFlaggings would be fine with an empty object.
Thanks,
Matthias
Active
5.0
Flag core
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.