/Drupal 8

class UpdateBuildIdCommand

AJAX command for updating the value of a hidden form_build_id input element on a form. It requires the form passed in to have keys for both the old build ID in #build_id_old and the new build ID in #build_id.

The primary use case for this Ajax command is to serve a new build ID to a form served from the cache to an anonymous user, preventing one anonymous user from accessing the form state of another anonymous user on Ajax enabled forms.

This command is implemented by Drupal.AjaxCommands.prototype.update_build_id() defined in misc/ajax.js. O


Related topics

Ajax API
Overview for Drupal's Ajax API.


core/lib/Drupal/Core/Ajax/UpdateBuildIdCommand.php, line 20




Name Modifiers Type Description
UpdateBuildIdCommand::$new protected property New build id.
UpdateBuildIdCommand::$old protected property Old build id.
UpdateBuildIdCommand::render public function Return an array to be run through json_encode and sent to the client. Overrides CommandInterface::render
UpdateBuildIdCommand::__construct public function Constructs a UpdateBuildIdCommand object.

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.