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'.
Joomla 3.6.2
Labels |
Added:
?
|
Category | ⇒ | Components |
Priority | Medium | ⇒ | Low |
Status | New | ⇒ | Confirmed |
Rel_Number | 0 | ⇒ | 12768 |
Relation Type | ⇒ | Related to |
Status | Confirmed | ⇒ | Needs Review |
Status is set on "Needs Review".
Labels |
Added:
J3 Issue
|
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
I'm going to close this as a won't fix.
Status | Needs Review | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-08-19 09:56:07 |
Closed_By | ⇒ | wilsonge |
Something here #12768 regarding missing data in modules com_config as well.