User tests: Successful: Unsuccessful:
Pull Request for Issue #30813 (comment)
The existing code prevents modifying the list limit as it is forced or by the Global Contacts List Layout Options, or the List Contacts in a Category
menu item params.
This normalizes the use of list limit, as done for other lists displaying in frontend, by deleting both fields and modifying the model code. Default is set to 20.
Create some contacts in a category.
Create a List Contacts in a Category
menu item.
Display the menu item in frontend.
Try to modify the list limit
Patch and test again.
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_contact Language & Strings Front End |
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Labels |
Added:
?
?
?
|
Sorry why should we hard code the default to 20? and what's the problem with our configuration option? don*t we use the same functionality in com_content?
I only looked at the code
- $limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->get('list_limit'), 'uint');
+ $limit = $app->input->get('limit', $app->get('list_limit', 20), 'uint');
and getuserstatefromrequest should do the same as input->get but also set the user preference in the session.
Edit: I miss read this as remove of the default, but it removes the com_contact .xml options if i'm not wrong?
don*t we use the same functionality in com_content?
Nope. We do not have a articles__num
as Options in the xmls for articles List Layouts
The contact specific field option in the xmls (contacts_display_num
) are unecessary as it is only used to force a specific limit which is ALWAYS set, which created the original issue
before the patch we had in Contacts CategoryModel:
$numberOfContactsToDisplay = $mergedParams->get('contacts_display_num');
if ($format === 'feed')
{
$limit = $app->get('feed_limit');
}
elseif (isset($numberOfContactsToDisplay))
{
$limit = $numberOfContactsToDisplay; // As this is always set, it forces that limit...
}
else
{
$limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->get('list_limit'), 'uint');
}
20
is indeed basically a default.
Same code is used for frontend Articles Model concerning the category list.
joomla-cms/components/com_content/src/Model/ArticlesModel.php
Lines 94 to 95 in 06fe4d2
and shouldnt the button be called search not filter?
That's what it is called for articles list.
COM_CONTENT_FORM_FILTER_SUBMIT="Filter"
JGLOBAL_FILTER_BUTTON
. It can be modified globally for all similar lists in frontend by using JSEARCH_FILTER_SUBMIT
if desired.Folks, I basically have done all these contacts related frontend list refactoring PRs based on what we already have for articles.
For example, there is a debate here about the use of a fieldset or not.
#30868
Taking out the fieldset element would also change the display, pushing the list limit to the right for the contacts lists. Articles may need more refactoring.
Labels |
As requested modified to use back getUserStateFromRequest
No change in behavior.
I have tested this item
I have tested this item
@HLeithner
Good to go.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-10-08 08:23:43 |
Closed_By | ⇒ | rdeutz |
I have tested this item✅ successfully on 5d62196
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30904.