Block title not hidden by default

Created on 31 January 2025, 24 days ago

Problem/Motivation

In the ManagedAdBlock class the blockForm() function claims it is unchecking the Display title by default, but when adding a block, Display title is still checked by default.

public function blockForm($form, FormStateInterface $form_state) {
    // Hide block title by default.
    $form['label_display']['#default_value'] = FALSE;

Proposed resolution

That setting needs to be moved from the blockForm() function to the defaultConfiguration() function. This will properly set the default value to unchecked.

public function defaultConfiguration() {
    return [
      'label_display' => FALSE,  // <---  ADD THIS INSTEAD
      'ad_slot' => '',
      'ad_format' => 'responsive',
      'ad_width' => '',
      'ad_height' => '',
      'ad_shape' => 'auto',
      'ad_layout_key' => '',
      'ad_align' => 'center',
    ];
  }
πŸ› Bug report
Status

Active

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jesss

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024