?
avatar infograf768
infograf768
14 Oct 2020

Steps to reproduce the issue

Create a tag.
Assign this tag to some articles.
Unpublish one of these articles.
Create a Compact List of Tagged Items menu item and display in frontend for this tag.

Code contains to check the core_state

<?php if ($item->core_state == 0) : ?>
<span class="list-published badge badge-warning">
<?php echo Text::_('JUNPUBLISHED'); ?>
</span>
<?php endif; ?>

The problem is that we never get the core_state if it is set to 0 as only items published are displayed.

The code was drastically modified in J4 vs J3 in the libraries/src/Helper/TagsHelper.php by the PR #27107 which got rid of the core_state array.

We have 2 solutions;

  1. We do not check anymore for core_state in the layout.
  2. We reinstate the query fetching for the possible array and publish up/down

@SharkyKZ

avatar infograf768 infograf768 - open - 14 Oct 2020
avatar joomla-cms-bot joomla-cms-bot - change - 14 Oct 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 14 Oct 2020
avatar infograf768 infograf768 - change - 14 Oct 2020
The description was changed
avatar infograf768 infograf768 - edited - 14 Oct 2020
avatar SharkyKZ
SharkyKZ - comment - 14 Oct 2020

This hasn't changed since J3. State filter is hardcoded here:

$this->setState('tag.state', 1);

avatar infograf768
infograf768 - comment - 15 Oct 2020

@SharkyKZ

State filter is hardcoded here:

Understand. Therefore it is not necessary to check for core_state in the layout. Will make PR.

BUT we have another issue due to #27107
You got rid of publish up and publish down
This means that an item can be Published but not available to display in these cases but is yet displayed => 404.

The modules have kept this case. For example TagsSimilarHelper.php still contains

			->extendWhere(
				'AND',
				[
					$db->quoteName('cc.core_publish_up') . ' IS NULL',
					$db->quoteName('cc.core_publish_up') . ' = :nullDateUp',
					$db->quoteName('cc.core_publish_up') . ' <= :nowDateUp',
				],
				'OR'
			)
			->bind(':nullDateUp', $nullDate)
			->bind(':nowDateUp', $now)
			->extendWhere(
				'AND',
				[
					$db->quoteName('cc.core_publish_down') . ' IS NULL',
					$db->quoteName('cc.core_publish_down') . ' = :nullDateDown',
					$db->quoteName('cc.core_publish_down') . ' >= :nowDateDown',
				],
				'OR'
			)
			->bind(':nullDateDown', $nullDate)
			->bind(':nowDateDown', $now);

Here the article articletest_publish_later is displayed in the compact list as well as in the normal list, but should not

Screen Shot 2020-10-15 at 09 52 51

But, it is not displayed in the Similar Tags Module, which is correct

Screen Shot 2020-10-15 at 09 49 37

In #27107 , I can see

Screen Shot 2020-10-15 at 10 01 10

Can you correct that?

avatar SharkyKZ
SharkyKZ - comment - 15 Oct 2020

Please test PR #31097.

avatar infograf768
infograf768 - comment - 15 Oct 2020

Closing as #31097 solves the issue. Thanks.

avatar infograf768 infograf768 - change - 15 Oct 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-10-15 08:27:59
Closed_By infograf768
avatar infograf768 infograf768 - close - 15 Oct 2020

Add a Comment

Login with GitHub to post a comment