protected function loadFormData() {
$data = new \stdClass();
$data->title = "Test entry";
$data->subform = array();
$subItem = new \stdClass();
$subItem->id = 2;
$subItem->listfield = array(2,3);
$subItem->date_1 = mktime(0,0,0,11,10,2019);
$subItem->date_2 = mktime(0,0,0,11,15,2019);
$data->subform[] = $subItem;
$subItem = new \stdClass();
$subItem->id = 3;
$subItem->listfield = array(1,3);
$subItem->date_1 = mktime(0,0,0,11,10,2020);
$subItem->date_2 = mktime(0,0,0,11,15,2020);
$data->subform[] = $subItem;
return $data;
}
Form fields are rendered with loaded data
Form fields (calendar) are all set to current date; only loaded once per fieldname, not per subform element
Ubuntu 22.04
Apache 2 Webserver
PHP 8.3
Joomla 5.1.0
If I comment out line 1353 in /libraries/src/Form/FormField.php (do not used previous stored layoutData), eg.
if ($this->layoutData) {
//return $this->layoutData;
}
forms fields are loaded as expected.
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
type="subform" clayout=
is that a typo?
Edit: this issue seems to match only for table-subforms, layout joomla.form.field.subform.repeatable-table. If default layout is set (I disabled by adding c before layout as in above example) everything works fine.
So two edits for example:
@Fedik fix checked, works, thanks!
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-04-18 14:56:06 |
Closed_By | ⇒ | Fedik |
I could not upload these files, so I put it here:
Main form:
Subform: