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);
|
$column_refs = $this->getOneColumnRefs($table);
|
||||||
$json_refs = $this->getOneJsonRefs($table);
|
$json_refs = $this->getOneJsonRefs($table);
|
||||||
|
|
||||||
$ids = array_shift($internal_array);
|
$ids = reset($internal_array);
|
||||||
foreach ($ids as $id) {
|
foreach ($ids as $id => $i) {
|
||||||
$create_item = true;
|
$create_item = true;
|
||||||
$this->fillCurrentItem($id, $table, $internal_array);
|
$this->fillCurrentItem($id, $table, $internal_array);
|
||||||
foreach ($this->currentItem['parsed'] as $column => $value) {
|
foreach ($this->currentItem['parsed'] as $column => $value) {
|
||||||
@ -3188,6 +3188,15 @@ class Prd
|
|||||||
{
|
{
|
||||||
$id = $crossed_refs[$table]['value'];
|
$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.
|
// Update current item crossed references.
|
||||||
if (isset($crossed_refs[$table]) === true
|
if (isset($crossed_refs[$table]) === true
|
||||||
&& empty($crossed_refs[$table]['ref']) === false
|
&& empty($crossed_refs[$table]['ref']) === false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user