Remove only not ref keys in items creation

This commit is contained in:
Enrique Martin 2024-02-07 19:32:08 +01:00
parent 47c6b9c335
commit afb6892ef0

View File

@ -2604,8 +2604,8 @@ class Prd
$column_refs = $this->getOneColumnRefs($table);
$json_refs = $this->getOneJsonRefs($table);
$ids = array_shift($internal_array);
foreach ($ids as $id) {
$ids = reset($internal_array);
foreach ($ids as $id => $i) {
$create_item = true;
$this->fillCurrentItem($id, $table, $internal_array);
foreach ($this->currentItem['parsed'] as $column => $value) {
@ -3188,6 +3188,15 @@ class Prd
{
$id = $crossed_refs[$table]['value'];
// Remove primary keys not references
foreach ($id as $id_column) {
if (in_array($id_column, $crossed_refs[$table]['ref']) === false
&& isset($this->columnRefs[$table][$id_column]) === false
) {
unset($this->currentItem['parsed'][$id_column]);
}
}
// Update current item crossed references.
if (isset($crossed_refs[$table]) === true
&& empty($crossed_refs[$table]['ref']) === false