Products have a status column, that is exposed to property info with the description "Boolean indicating whether the product is active or disabled", however the type of the column is not specified as boolean, but as text instead.

VBO uses the property info for the new "modify entity" action I'm writing, so instead of a checkbox, it shows an ugly textbox here.
Let's fix that.

CommentFileSizeAuthor
#1 1408664-fix-info.patch658 bytesbojanz

Comments

bojanz’s picture

Status: Active » Needs review
StatusFileSize
new658 bytes
rszrama’s picture

Hmm, we had a long discussion about this with fago with respect to the status column on users. I was in favor of having our property info match the data in the database, which is integer. If we change it to boolean, then any module that repurposes this column to allow for additional positive integer statuses would break if we only exposed status as a boolean in the property info.

bojanz’s picture

Any module that repurposes this column deserves a beating for using D5-style hacks.
It's our column, our data. We gain better UX and DX while losing nothing.

rszrama’s picture

Status: Needs review » Fixed

Yeah, I wouldn't exactly be a proponent of status column abuse, but my bigger problem is with entity property info not matching the data in the database. We're introducing a disparity between the table's schema and the property info, and that just feels like a recipe for disaster even if the property info is more specific.

But what the hey, I see that Customer Profiles already use boolean... I guess if it ever becomes an issue, we can change it then. I'll make sure all our "status" columns use boolean when I commit this.

bojanz’s picture

Well, it's not like mysql has a boolean type for us to use. So it's not that bad. We're doing what we have to.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.