Error: Call to a member function getThirdPartySetting() on null

Created on 17 June 2021, over 3 years ago
Updated 15 March 2024, 9 months ago

Problem/Motivation

The website encountered an unexpected error. Please try again later.
Error: Call to a member function getThirdPartySetting() on null in block_aria_landmark_roles_preprocess_block() (line 51 of modules/contrib/block_aria_landmark_roles/block_aria_landmark_roles.module).

Proposed resolution

Add condition to make sure the block is exist before calling the function.

    if ($block) {
      if ($role = $block->getThirdPartySetting('block_aria_landmark_roles', 'role')) {
        $variables['attributes']['role'] = $role;
      }

      if ($label = $block->getThirdPartySetting('block_aria_landmark_roles', 'label')) {
        $variables['attributes']['aria-label'] = $label;
      }
}
πŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States phuang07 New York

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024