foreach ($values as $flag_id => $value) {
// Get the flag from the Flag Service.
$flag = $flag_service->getFlagById($flag_id);
The flags should be loaded in bulk outside of the loop.
Postponed on #2764399: The user has already flagged the entity with the flag on editing flagged node → .
Fixed
4.0
Flag core
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.