Skip to content

Taxonomy term pages with image put image at bottom of page for only 1 or 2 items with that term #7060

@bugfolder

Description

@bugfolder

Description of the bug

If we create a taxonomy term with an image field and then give some nodes a term reference field that references that term, on the taxonomy term page, the term image shows incorrectly at the bottom of the page if there are only 1 or 2 nodes with that term, but correctly at the top of the page with 3 or more nodes.

Steps To Reproduce

To reproduce the behavior:

  • Create a vocabulary, e.g., "Clothes."
  • Add an image field to it. Give the image field a default image.
  • Create a new content type.
  • Add a term reference field to it.
  • Create three nodes of the content type, each of which has the term reference set to the "Clothes" vocabulary.
  • Go to the term page for "Clothes". It will show the term image at the top of the list of the 3 nodes, as one would expect.
  • Now, for one of the nodes, remove its term reference.
  • Revisit the term page for "Clothes." It now puts the term image at the bottom of the list of 2 nodes.

Expected behavior

The term should show up at the top of the list no matter how many nodes there are. Here's three nodes:

Image

And here's two nodes:

Image

Additional information

Tested on Backdrop 1.33.0. Initially discovered by an Ubercart user and reported there as backdrop-contrib/ubercart#575.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions