Skip to content

Commit

Permalink
[4.0] Set jform in API request for assigned catid (#36538)
Browse files Browse the repository at this point in the history
* Set jform i API request for assigned catid

* Update libraries/src/MVC/Controller/ApiController.php

Co-authored-by: Richard Fath <richard67@users.noreply.github.com>

* Update libraries/src/MVC/Controller/ApiController.php

Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>

Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>
  • Loading branch information
3 people committed Jan 25, 2022
1 parent ac81c31 commit 8702d3b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libraries/src/MVC/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,12 @@ protected function save($recordKey = null)

$data = $this->preprocessSaveData($data);

// TODO: Not the cleanest thing ever but it works...
// @todo Not the cleanest thing ever but it works...
Form::addFormPath(JPATH_COMPONENT_ADMINISTRATOR . '/forms');

// Needs to be set because com_fields needs the data in jform to determine the assigned catid
$this->input->set('jform', $data);

// Validate the posted data.
$form = $model->getForm($data, false);

Expand Down

0 comments on commit 8702d3b

Please sign in to comment.