Change record status: 
Project: 
Introduced in branch: 
10.2.x
Introduced in version: 
10.2.0
Description: 

Prior to #3380480: Views should require a label, rather than falling back to an unhelpful ID, view entities were allowed to not have labels. If a view's label() method was called, the view's ID would be reused if there was no explicit label.

This behavior is now deprecated -- it was only ever possible to do programmatically (Views' UI requires you to enter a label). View labels are now required by config schema, and trying to create a view without an explicit label will raise a config schema validation error in Drupal 11.

Before this change, this was allowed:

use Drupal\views\Entity\View;

$view = View::create(['id' => 'odo']);
$view->save();
$view->label();  // Will return 'odo'

That will now raise a deprecation error. In Drupal 11, you'll need to do this:

use Drupal\views\Entity\View;

$view = View::create(['id' => 'odo', 'label' => 'My favorite grump']);

This change does not impact the Views UI, and site builders should not notice any difference.

Impacts: 
Module developers