Missing User Statement causing fatal error

Created on 29 November 2024, 4 months ago

Problem/Motivation

I added a static mapping for the URL to my component (its just a simple teaser and I want to map the URL of the node) and ran into this error and a WSOD:

The website encountered an unexpected error. Try again later.

Error: Class "Drupal\sdc_display\BubbleableMetadata" not found in Drupal\sdc_display\Util::computePropValues() (line 117 of modules/contrib/sdc_display/src/Util.php).

Steps to reproduce

Add a view mode to a node, go to manage display and use an SDC component, use the static mapping section and insert [node:url] as the value in a text field. Load a page that should include the component. You'll see the error

Proposed resolution

This is a simple fix, we just need to add a use statement to /src/Util.php. I tested this locally and it solved the problem for me. I'll create an MR for this.

Remaining tasks

1. Add use statement to code
2. Test/Review patch

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States dustinleblanc Ithaca, NY

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

Merge Requests

Comments & Activities

  • Issue created by @dustinleblanc
  • πŸ‡ΊπŸ‡ΈUnited States dustinleblanc Ithaca, NY

    Alright quick MR submitted, thanks for this sweet module!

  • Pipeline finished with Success
    4 months ago
    Total: 148s
    #353767
  • πŸ‡ͺπŸ‡ΈSpain pcambra Asturies
  • Status changed to Postponed: needs info 2 months ago
  • πŸ‡ͺπŸ‡ΈSpain pcambra Asturies

    I'm not seeing where we use BubbleableMetadata on the Util file, mind providing more info?

  • πŸ‡ΊπŸ‡ΈUnited States dustinleblanc Ithaca, NY

    @pcambra, you're right...I can't find it anymore.

    The error said it was at line 117 in that file, but looking at the code, its not there. I've tried looking through the commit history and can't find it either. I have no idea what happened to cause this error to get thrown while I was testing out the module. When I opened up the file in my editor, the BubbleableMetadata was there and I added the import and the error went away. Must be some kind of errant keystroke somewhere modified the code for some reason...sorry for the confusion, I'll go ahead and close this issue. Thanks!

Production build 0.71.5 2024