Skip to content

Commit 038ebd2

Browse files
fix: correctly load parent model objects during read_all
1 parent 97803f7 commit 038ebd2

File tree

1 file changed

+4
-1
lines changed
  • pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core

1 file changed

+4
-1
lines changed

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/Model.inc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1968,7 +1968,10 @@ class Model {
19681968
$parent_id = is_numeric($parent_id) ? (int) $parent_id : $parent_id;
19691969

19701970
# Create a new Model object for this internal object and assign its ID
1971-
$model_object = new $model(id: $internal_id, parent_id: $parent_id);
1971+
$model_object = new $model(id: $internal_id, parent_id: $parent_id, skip_init: true);
1972+
1973+
# Obtain the parent Model object if this Model has a parent Model class assigned
1974+
$model_object->get_parent_model();
19721975

19731976
# Populate the Model object using its current internal values and add it to the array of all Model objects
19741977
$model_object->from_internal_object($internal_object);

0 commit comments

Comments
 (0)