Comments (6)
Was away most of today. No time to fully look into this tonight but it sounds logical. On the other hand, the affected row count from Model::update() should always be 1. If it's not something went wrong (Model::update() only updates the current instance, no others)
from core.
If you (with MySQL) fetch a record using Model::find(1) and then directly save it, affected rows is zero (update went ok, but no rows were updates since all values were the same).
If your controller contains a
if ($model->save())
{
// success
}
else
{
// failure
}
Your application will generate an error if the user requests a record, and clicks save without changing anything.
from core.
Actually, is_changed()
is run before save() is executed and when no change is detected it will always return true
from core.
Issue is in typing. MySQL stores everything as string, so when you retrieve a record, all column values are strings, However, the fields on my forms and the validation routines behind it aren't, so an int column which was retrieved as "10", will be set to 10 (int!) before calling save(), and I assume that is_changed() will then return true, although for MySQL still nothing has changed.
from core.
I just changed Orm\Query::update() to return true when affected rows is 0. fuel/orm@42e17df6
from core.
Thanks. This can be closed then.
from core.
Related Issues (20)
- v1.8.2 caused package/config/routes.php to stop registering with the router automatically HOT 9
- \Cache::delete_all() using memcached driver not clearing all items HOT 8
- In SecurityException, set_token is always called with true. HOT 5
- Issue with Request_Curl HOT 3
- like fuel HOT 3
- Soap Trace Options HOT 1
- How do you guys do php8 compatibility checks ? HOT 2
- update PDO methods pls HOT 1
- How do I update my markdown class HOT 3
- bug php 8 HOT 1
- URI path present in _GET / Input::get() in case of PHP7+fpm HOT 6
- setcookie(): Passing null to parameter #5 ($domain) of type string is deprecated PHP 8.1 HOT 1
- strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in PHP 8.1
- PHP 8.1 - Automatic conversion of false to array is deprecated in COREPATH/classes/config/file.php on line 105
- PHP8 OR LATER HOT 6
- Any plan to make a new release? HOT 11
- Profiler options HOT 1
- ORM count() returns incorrect row number HOT 9
- composite primary keys in CRUD HOT 5
- PHP 8.3 Problem with View Class : COREPATH/classes/view.php @ line 586 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.