diff -u b/src/Entity/Vote.php b/src/Entity/Vote.php --- b/src/Entity/Vote.php +++ b/src/Entity/Vote.php @@ -47,7 +47,7 @@ * {@inheritdoc} */ public function getVotedEntityType() { - return $this->get('entity_type')->value; + return $this->get('entity_type')->value;parent::postSave($storage, $update); } /** @@ -233,8 +233,8 @@ * * @see ::baseFieldDefinitions() * - * @return array - * An array of default values. + * @return int + * Current user id. */ public static function getCurrentUserId() { return \Drupal::currentUser()->id(); @@ -245,8 +245,8 @@ * * @see ::baseFieldDefinitions() * - * @return array - * An array of default values. + * @return string + * Get current user IP. */ public static function getCurrentIp() { return hash('sha256', serialize(\Drupal::request()->getClientIp())); @@ -256,6 +256,7 @@ * {@inheritdoc} */ public function postSave(EntityStorageInterface $storage, $update = TRUE) { + parent::postSave($storage, $update); if (\Drupal::config('votingapi.settings')->get('calculation_schedule') == 'immediate') { // Update voting results when a new vote is cast. \Drupal::service('plugin.manager.votingapi.resultfunction')