Skip to content
Snippets Groups Projects

Added description field for roles.

Open Youri van Koppen requested to merge issue/drupal-256287:256287-role-description into 11.1.x
6 unresolved threads

Closes #256287

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
134 134 label:
135 135 type: required_label
136 136 label: 'Label'
137 description:
  • 74 75 */
    75 76 protected $label;
    76 77
    78 /**
    79 * A brief description of this role.
    80 *
    81 * @var string
    82 */
    83 protected $description;
  • 105 113 return $this->permissions;
    106 114 }
    107 115
    116 /**
    117 * {@inheritdoc}
    118 */
    119 public function getDescription(): string {
    120 if (!isset($this->description)) {
  • 27 29 '#maxlength' => 64,
    28 30 '#description' => $this->t('The name for this role. Example: "Moderator", "Editorial board", "Site architect".'),
    29 31 ];
    32 $form['description'] = [
    33 '#type' => 'textarea',
    34 '#title' => $this->t('Description'),
    35 '#default_value' => $entity->getDescription(),
    36 '#description' => $this->t('Displays on the %page page.', [
  • 17 17 * {@inheritdoc}
    18 18 */
    19 19 public function form(array $form, FormStateInterface $form_state) {
    20 /** @var \Drupal\role\RoleInterface $entity */
  • 50 60 * {@inheritdoc}
    51 61 */
    52 62 public function save(array $form, FormStateInterface $form_state) {
    63 /** @var \Drupal\role\RoleInterface $entity */
    Please register or sign in to reply
    Loading