User tests: Successful: Unsuccessful:
There was a bug in state filtering of CategoryModel that lead to administrators seeing trashed items in the front-end.
Changed the state filter to filter the contact items.
Both contacts visible
Only contact A should be visible
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
Status | New | ⇒ | Pending |
Category | ⇒ | Front End com_contact |
How on earth showing trashed items only in the Contact component front-end is an intended behaviour?
How on earth showing trashed items only in the Contact component front-end is an intended behaviour?
The same with articles. Otherwise the admin is not able to untrash/publish etc a contact when managing in the front end. That is why the state of the contact is displayed. (Perhaps you have a template which is overriding this view and not displaying the status
How on earth showing trashed items only in the Contact component front-end is an intended behaviour?
The same with articles. Otherwise the admin is not able to untrash/publish etc a contact when managing in the front end. That is why the state of the contact is displayed. (Perhaps you have a template which is overriding this view and not displaying the status
It doesn't work like this in the Content component. And I just checked that to be sure for both blog and default layouts. Contact is the only place where I found such behaviour.
Even if the intended behaviour is not to display these contacts the PR is obvioulsy not complete as you would surely need to update this as well.
joomla-cms/components/com_contact/tmpl/category/default_items.php
Lines 126 to 153 in 36729f6
I think there are some bits missing, for example if the category is unpublished it shouldn't be shown.
Maybe check how it's done in com_content and replicate this to com_contact?
This pull request has been automatically rebased to 5.2-dev.
Title |
|
I think there are some bits missing, for example if the category is unpublished it shouldn't be shown. Maybe check how it's done in com_content and replicate this to com_contact?
Unpublished items for administrators are shown in most of the core components. But only Contact had Trashed items visible too. The behaviour is copied from com_content in this PR. Only missing bit are changes in the view layout to not check for trashed state but I have no time this week for this.
I think there are some bits missing, for example if the category is unpublished it shouldn't be shown. Maybe check how it's done in com_content and replicate this to com_contact?
I looked at how it is handled in com_content and indeed, something is missing here:
filter.published
model state for administrator should be set inside populateState method like this https://github.com/joomla/joomla-cms/blob/5.2-dev/components/com_content/src/Model/CategoryModel.php#L158, not hardcode to [0,1,2] in the getListQuery
method right now. Further more, we only show Pending and Published articles for administrator, guess it should be the same for contacts.@artur-stepien Could you please look at the feedback above to see if it is valid, and for valid items, update your PR with necessary change ?
I think there are some bits missing, for example if the category is unpublished it shouldn't be shown. Maybe check how it's done in com_content and replicate this to com_contact?
I looked at how it is handled in com_content and indeed, something is missing here:
* Only items from published categories should be shown https://github.com/joomla/joomla-cms/blob/5.2-dev/components/com_content/src/Model/ArticlesModel.php#L336 * The `filter.published` model state for administrator should be set inside populateState method like this https://github.com/joomla/joomla-cms/blob/5.2-dev/components/com_content/src/Model/CategoryModel.php#L158, not hardcode to [0,1,2] in the `getListQuery` method right now. Further more, we only show Pending and Published articles for administrator, guess it should be the same for contacts. * The layout should be updated as Brian pointed out.
@artur-stepien Could you please look at the feedback above to see if it is valid, and for valid items, update your PR with necessary change ?
If you want to create a PR feel free. I will not waste more time on another Joomla PR ignored for months.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2025-01-18 10:53:48 |
Closed_By | ⇒ | artur-stepien | |
Labels |
Added:
bug
PR-4.4-dev
PR-5.2-dev
|
There has to be another PR for category state filtering but the problem is 4.4 does not have subcategories filtering. Should I create a separate PR adding category state filtering for 4.4 and 5.1?