Problem/Motivation

When rebuilding my site using blt setup I encounter a fatal error at the drupal:config:import step:

Error: Call to a member function addWidget() on null in bynder_lightning_install() (line 43 of /app/docroot/modules/contrib/bynder/modules/lightning/bynder_lightning.install)

Steps to reproduce

Rebuild a site using Acquia BLT with the Lightning profile and the Bynder module installed. This appears to affect versions 2, 3 and 4 of the Bynder module.

Proposed resolution

I think checking for the existence of the entity browser $browser var first fixes this issue, so I will include a patch for this below. If there's a better solution please let me know!

Comments

djvern created an issue. See original summary.

djvern’s picture

StatusFileSize
new2.12 KB
avpaderno’s picture

Status: Active » Needs review
berdir’s picture

Status: Needs review » Needs work

If this happens on a config import then this is the wrong fix, instead, it should check for \Drupal::isConfigSyncing() and if so, return early.

  1. +++ b/modules/lightning/bynder_lightning.install
    @@ -8,11 +8,11 @@
    -function bynder_lightning_requirements($phase) {
    +function bynder_lightning_requirements($phase)
    +{
    

    this shouldn't be changed.

  2. +++ b/modules/lightning/bynder_lightning.install
    @@ -8,11 +8,11 @@
       if ($phase == 'install' && !\Drupal::moduleHandler()->moduleExists(
    -      'lightning_media'
    -    )
    -  ) {
    +    'lightning_media'
    +  )) {
         return [
           'bynder_lightning' => [
    

    this also either shouldn't be touched or then just all on a single line, doesn't matter if it's over > 80 characters.

hernani’s picture

Adding a patch with the suggested solution.

avpaderno’s picture

Status: Needs work » Needs review

  • Berdir committed 71e43a0 on 4.0.x authored by hernani
    Issue #3176520 by djvern, hernani: Config import fails when site re-...
berdir’s picture

Status: Needs review » Fixed

Thank you. Committed.

Lightning won't be supported anymore, so people won't use this much anymore, but makes sense as a fix.

Status: Fixed » Closed (fixed)

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