Skip to content
Snippets Groups Projects

Issue #3292429 by Nicasso, uberengineer: Return proper AjaxResponse on ajaxSubmit

@@ -4,12 +4,14 @@ namespace Drupal\votingapi_widgets\Form;
use Drupal\Component\Datetime\TimeInterface;
use Drupal\Component\Utility\Html;
use Drupal\Core\Ajax\AjaxResponse;
use Drupal\Core\Entity\ContentEntityForm;
use Drupal\Core\Entity\EntityRepositoryInterface;
use Drupal\Core\Entity\EntityTypeBundleInfoInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\votingapi\VoteResultFunctionManager;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Ajax\ReplaceCommand;
/**
* Form controller for rating.
@@ -210,7 +212,10 @@ class BaseRatingForm extends ContentEntityForm {
$form_state->setRebuild(TRUE);
return $form;
$response = new AjaxResponse();
$response->addCommand(new ReplaceCommand('#' . $form['#attributes']['id'], $form));
return $response;
}
/**
Loading