Strange problem with Cortex and Postgresql

44 views
Skip to first unread message

adkurz

unread,
Sep 7, 2020, 8:45:08 AM9/7/20
to Fat-Free Framework
Hello,

I have a problem with Cortex.

I am currently creating a tool for managing files. For this, newly created files have to be entered into another table.

I try the following:

$file = new \Model\File()

$file->name = 'test';

...

$file->save();

$history = new \Model\EditHistory();

$history->file = $file;

...

$history->save();

This procedure fails, however. Apparently the file model is reset after Save(), in any case $file->_id is null.

So I have no possibility to get the new id. Although I could use lastinsertid() from the DB, this leads to errors (wrong IDs) with many-to-many relations.

Also the attempt to use the returned model of the save method fails. 

The problem only exists if I use postgresql. With MYsql, everything works well, but for this project, I have to use postgres.

My system: Debian10, Cortex 1.7 (also tested with latest master commit), F3 3.7.2, Apache2, PHP 7.4. It also fails with psql 12 on Windows.

Is there a solution for this problem or am I doing something wrong?
Thanks and greetings
Adrian Kurz

ikkez

unread,
Sep 10, 2020, 5:10:54 PM9/10/20
to Fat-Free Framework
problem was the progres issue in the last release.. upgrade to dev-master fixed the issue
Reply all
Reply to author
Forward
0 new messages