? ? ? Pending

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
3 Oct 2020

Pull Request for Issue #30813 (comment)

Summary of Changes

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.

Testing Instructions

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.

Actual result BEFORE applying this Pull Request

limitbox_contacts-list-before

Expected result AFTER applying this Pull Request

limitbox_contacts-list-after

avatar infograf768 infograf768 - open - 3 Oct 2020
avatar infograf768 infograf768 - change - 3 Oct 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 3 Oct 2020
Category Administration com_contact Language & Strings Front End
avatar infograf768 infograf768 - change - 3 Oct 2020
The description was changed
avatar infograf768 infograf768 - edited - 3 Oct 2020
avatar infograf768 infograf768 - change - 3 Oct 2020
The description was changed
avatar infograf768 infograf768 - edited - 3 Oct 2020
avatar gostn gostn - test_item - 3 Oct 2020 - Tested successfully
avatar gostn
gostn - comment - 3 Oct 2020

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.

avatar richard67 richard67 - test_item - 3 Oct 2020 - Tested successfully
avatar richard67
richard67 - comment - 3 Oct 2020

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.

avatar richard67 richard67 - change - 3 Oct 2020
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 3 Oct 2020

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30904.

avatar richard67 richard67 - change - 3 Oct 2020
Labels Added: ? ? ?
avatar HLeithner
HLeithner - comment - 3 Oct 2020

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?

avatar brianteeman
brianteeman - comment - 3 Oct 2020

It is not hard coded to 20. It uses the list_limit defined in global configuration. But as also shown below I dont get the same layout - and shouldnt the button be called search not filter?

image

image

avatar HLeithner
HLeithner - comment - 3 Oct 2020

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?

avatar infograf768
infograf768 - comment - 4 Oct 2020

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.

$value = $app->input->get('limit', $app->get('list_limit', 0), 'uint');
$this->setState('list.limit', $value);

and shouldnt the button be called search not filter?

That's what it is called for articles list.

<button type="submit" name="filter_submit" class="btn btn-primary"><?php echo Text::_('COM_CONTENT_FORM_FILTER_SUBMIT'); ?></button>

COM_CONTENT_FORM_FILTER_SUBMIT="Filter"
I have not changed this. Just mimicked it for contacts by using a Global string JGLOBAL_FILTER_BUTTON. It can be modified globally for all similar lists in frontend by using JSEARCH_FILTER_SUBMIT if desired.
I remind you that you tested that PR OK and the layout does not change with this patch. It should be tested with a 4.0-dev test site where npm ci has been run.
#30813 (comment)

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.

avatar infograf768 infograf768 - change - 5 Oct 2020
Labels
avatar infograf768
infograf768 - comment - 5 Oct 2020

As requested modified to use back getUserStateFromRequest
No change in behavior.

avatar chmst chmst - test_item - 6 Oct 2020 - Tested successfully
avatar chmst
chmst - comment - 6 Oct 2020

I have tested this item successfully on daf7d61


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30904.

avatar gostn gostn - test_item - 6 Oct 2020 - Tested successfully
avatar gostn
gostn - comment - 6 Oct 2020

I have tested this item successfully on daf7d61


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30904.

avatar infograf768
infograf768 - comment - 6 Oct 2020

@HLeithner
Good to go.

avatar rdeutz rdeutz - change - 8 Oct 2020
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
avatar rdeutz rdeutz - close - 8 Oct 2020
avatar rdeutz rdeutz - merge - 8 Oct 2020

Add a Comment

Login with GitHub to post a comment