bcosca / fatfree

A powerful yet easy-to-use PHP micro-framework designed to help you build dynamic and robust Web applications - fast!
2.66k stars 446 forks source link

Potential cache issue with save() #1224

Closed iFlash closed 3 years ago

iFlash commented 3 years ago

Hello,

I have come across an odd behavior:

I load a database row via load. Then I copy it like this:

            $sell->copyto('tmp');
            $sell->reset();
            $sell->copyfrom('tmp');
            $sell->id=false;

and save it $sell->save();

I would expect to have the newly created row id in $sell->id (it's an auto increment field).

But instead all fields of the newly created row seem empty.

But: When I inspect the database, the row IS THERE with all the correct values. It is just not present right after I created it. I assume this is some cache issue.

Is there a way to force the cache to flush?

xfra35 commented 3 years ago

Which version of the framework are you running? There have been a few fixes released in 3.7.3 which were dealing with that kind of issue.

Also which SQL engine are you using?

iFlash commented 3 years ago

I am running 3.7.1

I am always a bit scared of updating because in the past too many things broke when I did.

I am using the MySQL engine.

EDIT: I updated to 3.7.3. and I can confirm the bug has gone. Awesome. Fingers crossed, nothing else is broken …

ikkez commented 3 years ago

great news ;)