Problem/Motivation

The settings form saves `show_unpublished`, but neither the summary-count query nor the fallback content table uses that setting. With the setting disabled, unpublished nodes are still included in total counts and displayed in the fallback table.

Issues

Issues

Steps to reproduce

  1. Install Taxonomy Content Report.
  2. Configure a vocabulary and map a content type's taxonomy reference field.
  3. Leave `Include unpublished content in counts` unchecked.
  4. Create one published node and one unpublished node in the mapped content type, both tagged with the configured vocabulary.
  5. Visit `/admin/reports/taxonomy-content-report`.

Expected

Unpublished content is excluded from the report while the setting is disabled.

Actual

The unpublished node is included in counts and can appear in the fallback table.

Proposed resolution

Pass the setting into the report query layer and add `n.status = 1` conditions when `show_unpublished` is FALSE. Apply the same behavior to embedded/fallback section rendering where possible.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dkmishra created an issue. See original summary.

dkmishra’s picture

Version: 1.1.0 » 1.x-dev

gurkawal made their first commit to this issue’s fork.

gurkawal’s picture

StatusFileSize
new41.26 KB

Hi @dkmishra

I was able to reproduce this issue.

The setting “Include unpublished content in counts” was being saved correctly, but it was not being used while building the report data.
Because of this, unpublished nodes were still being counted even when this option was unchecked. The fallback table also had the same issue, so unpublished nodes could still appear there.

I have created a merge request with a small fix so only published nodes are counted and displayed.

When the setting is checked, both published and unpublished nodes are included as before.

sjpeters79’s picture

Hi @gurkawal. Thanks for the MR. It looks good. I've merged the change.

sjpeters79’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

sjpeters79’s picture

I'll tag a release early next week with this fix.

dkmishra’s picture

Hi @sjpeters79,

Thanks for merging this issue.

I noticed that I wasn't granted issue credit. Since I originally reported the issue and proposed the resolution, would you mind adding issue credit for my contribution if you feel it's appropriate?

Thanks!

sjpeters79’s picture

Hi @dkmishra. I've updated the contribution. Thanks.

dkmishra’s picture

Thank you @sjpeters79

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.