Updates Requested PR-4.1-dev psr12

Pending

User tests: Successful: Unsuccessful:

avatar pe7er
pe7er
17 May 2022

Pull Request to fix missing context for com_fields when doing actions like publishing or unpublishing Field or Field Group items.

Summary of Changes

In the Custom Field Groups and Custom Fields of Content & Users, the left menu closed after doing an action (like publish or unbublish) on a Custom Field Group Item or Custom Field Item.

Field Groups menu closes when doing actions

  1. In back-end go to: Content > Field Groups
  2. Create a Field group and Save & Close
    field-groups-1
  3. Notice the URL:
    /administrator/index.php?option=com_fields&view=groups&context=com_content.article
  4. Unpublish the Group
    field-groups-2
  5. Notice the new URL and the closed Menu:
    /administrator/index.php?option=com_fields&view=groups
    The Context is not passed through, and the menu has been closed.
    The same issue happens in other places with other Custom Fields too.

Testing Instructions

Go to each of the following menu items and publish or unpublish an item:

  1. Content > Field Groups /administrator/index.php?option=com_fields&view=groups&context=com_content.article
  2. Content > Fields /administrator/index.php?option=com_fields&view=fields&context=com_content.article
  3. Users > Field Groups /administrator/index.php?option=com_fields&view=groups&context=com_users.user
  4. Users > Fields /administrator/index.php?option=com_fields&view=fields&context=com_users.user
    /administrator/index.php?option=com_fields&view=fields&context=com_content.article

Actual result BEFORE applying this Pull Request

After doing a publish or unpublish action in com_fields, the menu on the left closes because the URL is missing the &context=[component][view]

Expected result AFTER applying this Pull Request

After doing a publish or unpublish action in com_fields, the menu on the left remains open because the right context &context=[component][view] is passed through via the URL.

avatar pe7er pe7er - open - 17 May 2022
avatar pe7er pe7er - change - 17 May 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 17 May 2022
Category Libraries
avatar brianteeman
brianteeman - comment - 17 May 2022

also see #34067

avatar pe7er pe7er - change - 17 May 2022
Labels Added: PR-4.1-dev
avatar joomdonation
joomdonation - comment - 25 Jun 2022

@pe7er The propose change does not look right to me. For this, you should modify code in Fields and Groups controllers of com_fields instead. Just add getRedirectToListAppend method to the two controllers with the below code should solve the issue:

protected function getRedirectToListAppend()
{
	$context = $this->input->getString('context');

	if ($context)
	{
		return '&context=' . $context;
	}
}
avatar HLeithner
HLeithner - comment - 27 Jun 2022

This pull requests has automatically rebased to 4.2-dev.

avatar joomla-bot
joomla-bot - comment - 27 Jun 2022

This pull requests has been automatically converted to the PSR-12 coding standard.

avatar HLeithner HLeithner - change - 27 Jun 2022
Labels Added: Updates Requested psr12

Add a Comment

Login with GitHub to post a comment