Problem/Motivation

Multiple PHP warnings get triggered when inserting a new grid block.

Warning: Undefined array key "default_layout" in Drupal\ckeditor_bs_grid\Form\GridDialog->buildLayoutStep() (line 274 of /var/www/html/web/modules/contrib/ckeditor_bs_grid/src/Form/GridDialog.php).

// Allow defaulting by sort order instead.
      elseif ($breakpoint['columns'][$num_cols]['default_layout'] === 'order') {
        $keys = array_keys($options);
        $default_layout = $keys[1] ?? $default_layout;
      }

I don't know what the default behavior should be here, so I can't offer a fix, but I'm attaching a minimal patch to suppress the warning messages - should someone need it.

The warnings are not triggered by editing an existing grid block.

Steps to reproduce

PHP 8.2.15
Drupal core 10.2.5
CKEditor Bootstrap Grid 2.0.11

  1. Start creating or editing content.
  2. Click on the insert grid icon.
  3. Click next.
  4. Check the logs for the triggered warnings.

Proposed resolution

Fix the default logic.

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Karol Haltenberger created an issue. See original summary.

karol haltenberger’s picture

Issue summary: View changes

abhishek_gupta1 made their first commit to this issue’s fork.

abhishek_gupta1’s picture

Status: Active » Needs review

@Karol Haltenberger , above patch fixed the issue, verified locally, also I created MR. please review it once.

mitthukumawat’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new76.8 KB

I have verified this fix. Taken the pull from this issue branch and it resolved the warning.

b_sharpe made their first commit to this issue’s fork.

b_sharpe’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

karol haltenberger’s picture

@b_sharpe So I don't really care about such stuff...but shouldn't I be also credited here.