?
avatar Bakual
Bakual
30 May 2017

Steps to reproduce the issue

Trash or archive an article

Expected result

Trashed and archived articles don't show in the list expect when search filter is set to show them.

Actual result

All articles show.

Additional comments

After clearing the search filters with the button, the list filters as expected until you log out and in again.

avatar Bakual Bakual - open - 30 May 2017
avatar joomla-cms-bot joomla-cms-bot - change - 30 May 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 30 May 2017
avatar brianteeman
brianteeman - comment - 30 May 2017

this is the same as in J3

avatar Bakual
Bakual - comment - 30 May 2017

this is the same as in J3

Can't reproduce it in current staging. By default, trashed and archived articles aren't shown in the manager. You need to either filter by that state or set it to "All"
I'm talking about the admin manager list, just in case you were looking somewhere else (I wasn't clear in the issue).

avatar Bakual Bakual - edited - 30 May 2017
avatar brianteeman
brianteeman - comment - 30 May 2017

now i am very confused what you are talking about

avatar Bakual
Bakual - comment - 30 May 2017

Article Manager after being freshly logged in. Note that articles of all states are shown with no filter active.
all
After clicking "clear", it now only shows published and unpublished articles. That's the expected behavior and is also the behavior in J3.
clear
Hope that helps.

avatar brianteeman
brianteeman - comment - 30 May 2017

ah - now I understand what you are saying

avatar esedic
esedic - comment - 30 May 2017

These are my findings (tested on sample data of 4.0-dev branch on PHP 5.6.24):
login to administration, go to article manager, you see a list of articles.
Check an article, click on Trash button in toolbar. After page refresh, article will stay on the list, same goes for Archived articles.
Till now expected behavior was that after that trashed/archived article was no longer visible on the list of articles.
If you use filters in Search tools, for example to filter trashed articles only and after that select -Select status- in dropdown and reset filter, you will get a list without trashed/archived articles.
If you have trashed/archived articles from before, they will be visible when you visit Article manager.

avatar brianteeman
brianteeman - comment - 30 May 2017

I can confirm this - see movie - helps others

thomas

avatar joomla-cms-bot joomla-cms-bot - change - 30 May 2017
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 30 May 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 30 May 2017
Status New Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 30 May 2017
Category com_content
avatar joomdonation
joomdonation - comment - 31 May 2017

This issue is related to the change in my PR #15455

Now, the first time you visit the page, the $published value has value null instead of '' (empty string) like before. There are different ways to fix it:

  1. Change this line of code https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_content/Model/Articles.php#L243 to
$published = (string) $this->getState('filter.published');
  1. Modify populateState method in the Articles model, add this line of code to setup default value for filter.published

$this->setState('filter.published', '');

Do you think which one is best @Bakual?

avatar Bakual
Bakual - comment - 31 May 2017

I came to same conclusion (null vs '') but couldn't figure out which PR was responsible ?
My solution would be to just loosen the comparision like this elseif ($published == ''), but casting to string would work as well. I wouldn't add something to the populateState method thought.

avatar joomdonation
joomdonation - comment - 31 May 2017

PR #16389

avatar Bakual
Bakual - comment - 31 May 2017

Closing as we have a PR

avatar Bakual Bakual - change - 31 May 2017
The description was changed
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2017-05-31 13:23:24
Closed_By Bakual
avatar Bakual Bakual - close - 31 May 2017

Add a Comment

Login with GitHub to post a comment