Comments (6)
Solved #2
from ar-position.
Empty value for the attribute not always means it is actually null
. For example: 0
value can be a valid one.
I assume you have this problem, because you collect group attribute data from a web form.
You should setup a filter validator, which will typecast empty string ('') into null
in such case.
from ar-position.
Actually my group attribute is a nullable foreign key, which means that some entities have a category and some not, and it will never have a 0
value.
But I used empty()
instead of is_null()
because for some reason the line $this->owner->$attribute;
was returning an empty string, not a null
value as it was supposed to, based on my db data.
Anyway, You´re right, It´s still a bug. I'll figure out a solution for the zero's case.
from ar-position.
0
is not the same as empty, though php evaluates that way. But even assuming it's the same, your code should handle with this instead of behaving randomly.
By the way, my group attribute is not coming from a web form, it's a foreign key.
from ar-position.
it's the same, your code should handle with this instead of behaving randomly.
Seems you are not paying attention: you are not only developer in this world, remember?
For someone else values like 0
or empty string `` can be considered as valid, and their typecast is not desiarable.
my group attribute is not coming from a web form, it's a foreign key.
Then how it becomes empty, but NOT null
?
If the group attribute value is set to null
it is handled correctly. You should check your code, so it ensures empty value conversion or correct null
setup.
from ar-position.
Then how it becomes empty, but NOT null?
It's a good question. Maybe you are right, Maybe I have a bug in my code. But it flees entirely to the main subject. your code doesn´t handle well with empty values. Period.
Seems you are not paying attention: you are not only developer in this world, remember?
Really? keep your buggy code then.
What a waste of time...
from ar-position.
Related Issues (8)
- Position is not updated when deleting the record HOT 3
- How to handle categories coming from a junction table? HOT 4
- Allow to set group attribute value directry HOT 2
- Cant use method movePrev in "position in group" HOT 2
- First and last checkers need HOT 2
- [ENH] Add new property `insertDefaultPosition` HOT 1
- Update groupAttribute 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 ar-position.