pimcore-data-definitions icon indicating copy to clipboard operation
pimcore-data-definitions copied to clipboard

PrimaryKeyLoader doesn't properly process NULL

Open dkarlovi opened this issue 4 years ago • 3 comments
trafficstars

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Branch? master

You have use cases where you need a composite primary key to actually contain NULL. This is currently not possible with the PrimaryKeyLoader.

The code might be something like

                    $value = $data[$map->getFromColumn()];
                    if ($value === null) {
                        $condition[] = '`'.$map->getToColumn().'` IS NULL';
                    } else {
                        $condition[] = '`'.$map->getToColumn().'` = ?';
                        $conditionValues[] = $value;
                    }

dkarlovi avatar Aug 19 '21 10:08 dkarlovi

PR?

dpfaffenbauer avatar Aug 19 '21 10:08 dpfaffenbauer

Yes, will do them all in one large effort, these are reminders for myself. :)

dkarlovi avatar Aug 19 '21 10:08 dkarlovi

perfect, thanks a lot

dpfaffenbauer avatar Aug 19 '21 10:08 dpfaffenbauer