I'm using a frontend JForm to manipulate some data. The html form is correct, but when it is sent back to the model save function I don't receive all data.
This is the data that
save receives through
Array ( [created] => XXXXXXXXXXXXXXXXX [updated] => XXXXXXXXXXXXXXXXX [wasteId] => X [price] => XXXX [pricenight] => XXX [pricefreeday] => XXXX [pricefreedaynight] => XXXX [tags] => )
But when I use
$formData = new JRegistry($this->input->get('jform', '', 'array'));
or when I got the data as the JControllerForm save method does
$formData = new JRegistry($this->input->post->get('jform', array(), 'array'));
Joomla\Registry\Registry Object ( [data:protected] => stdClass Object ( [wasteId] => X [price] => XXXX [pricenight] => XXX [pricefreeday] => XXXX [pricefreedaynight] => XXXX [contractId] => Array (  => XX  => XX ) [created] => XXXXXXXXXXXXXXXXX [updated] => XXXXXXXXXXXXXXXXX [id] => XX ) )
contractId are missing in the
Any idea of what should I do to have
contractId and id on the
$data parameter of the model
By the way, the model I'm using is derived from JModelAdmin and the controller is derived from JControllerForm. The controller has no overriden functions which may affect the way it collects data from the form.
More clues: inspecting the
JControllerForm::save more in detail I've seen that
$data has the
id component with the correct value but it gets overwritten with an empty value around line 637 because of this:
$recordId = $this->input->getInt($urlVar); // around line 634 of JControllerForm
$recordId to an empty value, in spite of
$urlVar value is "id". Then later, around line 637 of JControllerForm $data["id"] is changed:
$data[$key] = $recordId
$key value is "id" and
$recordId is empty.