Closed jekabsmilbrets closed 8 years ago
That happens in the underlaying F3 SQL Mapper when you set a value to a fields that is not existing. When you set:
$mapper->foo = 'bar'
and foo is not existing, the F3 mapper thinks it's a virtual fields, creating a (bar) as foo
expression.
Maybe the field cache is wrong. try to clear your tmp/ folder or CACHE engine.
cache it was!
something awkward is now happening
here is code, that worked before update: ` $copy_rotation_model = new \Model\CopyRotation();
$copy_rotation_model->has('_sales_areas', ['_id IN ?', explode(',', $this->INPUT_DATA['_sales_areas'])]);
// $copy_rotation_model->filter('_sales_areas', ['_id IN ?', explode(',', $this->INPUT_DATA['_sales_areas'])]);
$copy_rotation_model->has('_product', ['_id = ?', $this->INPUT_DATA['_product']]);
$copy_rotation_model->has('_time_ranges', ['start_time >= ? AND end_time <= ?', $this->INPUT_DATA['start_time'], $this->INPUT_DATA['end_time']]);
$query = [
'start_date >= ? AND end_date <= ?',
$this->INPUT_DATA['start_date'],
$this->INPUT_DATA['end_date']
];
$found_copy_rotations = $copy_rotation_model->find($query);
`
But after update this error shows up!
"[lib/base.php:2041] Base->error(500,'PDOStatement: Unknown column 'copyrotation.start_copyrotation.date' in 'where clause'')" "[lib/DB/Cortex.php:780] DB\SQL->exec('SELECT
copyrotation
.* FROMcopyrotation
LEFT JOIN_copy_rotations__sales_areas
ONcopyrotation
.id
=_copy_rotations__sales_areas
._copy_rotations
LEFT JOINsalesareas
ON_copy_rotations__sales_areas
._sales_areas
=salesareas
.id
LEFT JOINproduct
ONcopyrotation
._product
=product
.id
WHERE ((copyrotation.start_copyrotation.date >= ? AND copyrotation.end_copyrotation.date <= ?) and (salesareas._copyrotation.id IN (?,?,?))) and (product.id = ?) and (copyrotation.id IN (?,?)) GROUP BYcopyrotation
.id
',[1=>'2015-12-01',2=>'2015-12-31',3=>'1',4=>'2',5=>'3',6=>'1',7=>1,8=>2],0)", "[lib/DB/Cortex.php:580] DB\Cortex->filteredFind(['start_date >= ? AND end_date <= ?','2015-12-01','2015-12-31'],NULL,0)",
alright. must be something with the new regex and some _
chars. I'll review this.
should be fixed now.
yes, thank you! :)
After update/fix for #21
I'm having very interesting glich.
I have small script that is "mass-insert" within transaction, before that hotfix for #21 everything worked perfect, but now i get errors: btw all data is inserted with copyfrom($array)
its intersting as its trying to select actual value as field name, why ?!