File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Fields Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -217,16 +217,16 @@ class ForeignModelField extends Field {
217217 * @return mixed The field value in its representation form.
218218 */
219219 protected function _from_internal (mixed $ internal_value ): mixed {
220- # If the model_field_internal, and the model_field are the same, return the internal value as-is.
221- if ($ this ->model_field_internal === $ this ->model_field ) {
222- return $ internal_value ;
223- }
224-
225220 # Ensure the internal field value is converted to its representation value before querying
226221 if ($ this ->model_field_internal !== 'id ' ) {
227222 $ internal_value = $ this ->models [0 ]->{$ this ->model_field_internal }->_from_internal ($ internal_value );
228223 }
229224
225+ # If the model_field_internal, and the model_field are the same, return the internal value as-is.
226+ if ($ this ->model_field_internal === $ this ->model_field ) {
227+ return $ internal_value ;
228+ }
229+
230230 # Query for the Model object this value relates to.
231231 $ query_modelset = $ this ->__get_matches ($ this ->model_field_internal , $ internal_value );
232232
You can’t perform that action at this time.
0 commit comments