micronode_get_node_types caches result incorrectly

Created on 6 March 2023, almost 2 years ago
Updated 20 March 2023, almost 2 years ago

Problem/Motivation

First, thanks for the excellent module!

I'm reporting this bug, but it was actually discovered by my teammate @iarla, so hopefully we can give him credit when the time comes. :)

We're calling micronode_get_node_types() as part of some custom entity autocomplete functionality.micronode_get_node_types is getting called on the same request somewhere else with a different argument. That result is getting statically cached with drupal_static and being returned when we call micronode_get_node_types with a differnent argument. So we end up getting the opposite of what we want! Oh no!

Steps to reproduce

Call micronode_get_node_types with different arguments during the same request. See fail test.

Proposed resolution

Replace drupal_static with a cache service. drupal_static is kind of on the way out anyway.

Remaining tasks

Patches to follow.

User interface changes

None

API changes

Fix to caching bug in API

Data model changes

None

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States danflanagan8 St. Louis, US

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

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