getNidsByTid not always returning a node

Created on 20 July 2022, over 2 years ago
Updated 31 March 2024, 8 months ago

Problem/Motivation

The expected result from the getNidsByTid function is to always return a node instances, but there could be cases (like mine) that this function is not returning only nodes or there are some relations in the 'taxonomy_index' table which doesn't exists anymore and in such cases the module is not working and it's throwing the following error:

Error: Call to a member function toLink() on null in Drupal\taxonomy_replace\Form\TaxonomyReplaceForm->buildForm(), line 93

Proposed resolution

I've added a 'join' relation to the query in getNidsByTid(), to be sure that the returned IDs are nodes.

📌 Task
Status

Fixed

Version

1.2

Component

Code

Created by

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