Skip to content

Commit ff4e44a

Browse files
fix(Model): ensure model cache is updated intermittently during replace_all
1 parent c7c8eac commit ff4e44a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2463,6 +2463,10 @@ class Model {
24632463
$model_object->id = count($new_objects->model_objects);
24642464
$model_object->validate(modelset: $new_objects);
24652465
$new_objects->model_objects[] = $model_object;
2466+
2467+
# In the event that the model can reference itself (e.g. FirewallAlias), ensure the model cache is
2468+
# updated so ForeignModelField can accurately find referenced objects.
2469+
self::get_model_cache()::cache_modelset($new_objects);
24662470
}
24672471

24682472
self::clear_model_cache();

0 commit comments

Comments
 (0)