Change record status: 
Project: 
Introduced in branch: 
8.0.x
Description: 

Previously, Forms had to specify their callbacks like this:

$form['submit']['#submit'][] = array($this, 'mySubmitMethod');

Now, they can specify it like this:

$form['submit']['#submit'][] = '::mySubmitMethod';

Apart from being more complicated, the old code also had the problem that the form object was then serialized, when the submit callback was executed, a new form object was created but the submit callback was called on the old instance of the object. Especially in the case of form rebuilds, this resulted in inconsistencies between $this->someProperty in the submit and buildForm() methods.

A hack in entity forms was removed that was working around this problem, so that $this->entity was working as expected. This hack has been removed, so entity forms must be updated to specify their submit callbacks like this.

Impacts: 
Module developers