Skip to content

Commit

Permalink
Fix array to string conversion warning in array_diff. Changed to arra…
Browse files Browse the repository at this point in the history
…y_merge for combining _at, _in, and primary_key arrays before array_diff.
  • Loading branch information
henrystivens committed Jan 3, 2024
1 parent d92ff59 commit a30d757
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/extensions/helpers/model_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static function create(object $model, string $action = ''): void
$pk = $model->primary_key[0];
echo '<input id="', $model_name, '_', $pk, '" name="', $model_name, '[', $pk, ']" class="id" value="', $model->$pk , '" type="hidden">' , PHP_EOL;

$fields = array_diff($model->fields, [$model->_at, $model->_in, $model->primary_key]);
$fields = array_diff($model->fields, array_merge($model->_at, $model->_in, $model->primary_key));

foreach ($fields as $field) {
$tipo = trim(preg_replace('/(\(.*\))/', '', $model->_data_type[$field])); //TODO: recoger tamaño y otros valores
Expand Down

0 comments on commit a30d757

Please sign in to comment.