J3 Issue ?
Related to # 12768
avatar nvyush
nvyush
30 Sep 2016

Steps to reproduce the issue

The model /administrator/components/com_modules/models/module.php of the component com_modules can load the form data from the session - method loadFormData contains at the start:

$data = JFactory::getApplication()->getUserState('com_modules.edit.module.data', array());

but controllers don't contain methods to set the session variable 'com_modules.edit.module.data'.

I suggest add to controller /administrator/components/com_modules/controllers/module.php the method setData:

	public function setData()
	{
		JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

		$data = $this->input->post->get('jform', array(), 'array');
		JFactory::getApplication()->setUserState('com_modules.edit.module.data', $data);
		$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=module' . $this->getRedirectToItemAppend($this->input->get('id')), false));
	}

Then we can create custom module fields with relations i.e. field 'extension' - field 'category'.
Similar behavior has a field 'Menu item type'.

Expected result

Actual result

System information (as much as possible)

Additional comments

Joomla 3.6.2

avatar nvyush nvyush - open - 30 Sep 2016
avatar brianteeman brianteeman - change - 1 Oct 2016
Labels Added: ?
avatar brianteeman brianteeman - change - 2 Oct 2016
Category Components
avatar joomla-cms-bot joomla-cms-bot - change - 4 Mar 2017
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 4 Mar 2017
avatar PhilETaylor
PhilETaylor - comment - 4 Mar 2017

Something here #12768 regarding missing data in modules com_config as well.

avatar franz-wohlkoenig franz-wohlkoenig - change - 5 Apr 2017
Priority Medium Low
Status New Confirmed
Rel_Number 0 12768
Relation Type Related to
avatar franz-wohlkoenig franz-wohlkoenig - change - 9 Nov 2017
Status Confirmed Needs Review
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 9 Nov 2017

Status is set on "Needs Review".

avatar brianteeman brianteeman - change - 25 Mar 2018
Labels Added: J3 Issue
avatar brianteeman brianteeman - labeled - 25 Mar 2018
avatar wilsonge
wilsonge - comment - 19 Aug 2018

This has nothing to do with Phil's linked PR. Generally the session data is used to persist the form when there was invalid data in the form. It's not been a hook point for people to modify the data (indeed given a lot of the time the session data can be invalid you actively not be doing anything with this data) and also the comment here

// Check the session for previously entered form data.

I'm going to close this as a won't fix.

avatar wilsonge wilsonge - change - 19 Aug 2018
Status Needs Review Closed
Closed_Date 0000-00-00 00:00:00 2018-08-19 09:56:07
Closed_By wilsonge
avatar wilsonge wilsonge - close - 19 Aug 2018

Add a Comment

Login with GitHub to post a comment