Problem/Motivation

Error: Call to a member function getValue() on null in ebt_cta_preprocess_block() (line 42 of ebt_cta.module)

Steps to reproduce

Upgrading to Drupal 11.2+ and attempting to edit the layout using layout plugin throws this error.

Also other ebt_* modules like ebt_webform_popup have the same issue

Proposed resolution

Check for null on block content and also add a check to ensure block content hasField

But i still can't get the block to display even after using the patch i have generated

Issue fork ebt_cta-3532513

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

thomas kaisuka created an issue. See original summary.

levmyshkin’s picture

Hi Thomas Kaisuka, use hasField() method to check ebt_settings field exists. I didn't reproduce this problem yet, and it's possible for to reproduce only if remove the field manually.

levmyshkin’s picture

Here is the same problem for another module:
https://www.drupal.org/project/ebt_hero/issues/3530929

I don't have my laptop with me so I can apply your patch only from phone.

  • levmyshkin committed 53c4be87 on 1.4.x
    Issue #3532513 by thomas kaisuka: Error: Call to a member function...
levmyshkin’s picture

I added commit in 1.4.x dev branch with my phone, but I can't test the changes for now to release these changes. Obviously I need to add this validation for all EBT modules.

levmyshkin’s picture

Status: Active » Needs review
levmyshkin’s picture

Added validation for field_ept_settings, field_ebt_settings fields exist for all EBT/EPT modules.

levmyshkin’s picture

Status: Needs review » Fixed
levmyshkin’s picture

Status: Fixed » Closed (fixed)