mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 15:54:29 +02:00
Remove only not ref keys in items creation
This commit is contained in:
parent
47c6b9c335
commit
afb6892ef0
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user