Follow up from #1735118: Convert Field API to CMI

Investigate whether we can change other magic integers into nice constants in Field API

Files: 
CommentFileSizeAuthor
#14 interdiff.txt2.03 KBandypost
#14 1966998-14.patch14.6 KBandypost
PASSED: [[SimpleTest]]: [MySQL] 54,495 pass(es).
[ View ]
#12 interdiff.txt8 KBandypost
#12 1966998-12.patch12.58 KBandypost
PASSED: [[SimpleTest]]: [MySQL] 54,483 pass(es).
[ View ]
#9 1966998-9.patch5.07 KBswentel
PASSED: [[SimpleTest]]: [MySQL] 54,483 pass(es).
[ View ]

Comments

swentel’s picture

Title:Add a constant for for active storage vs. inactive storage» Add a constant for active storage vs. inactive storage
swentel’s picture

Title:Add a constant for active storage vs. inactive storage» Add a constant OR use TRUE/FALSE for active storage vs. inactive storage and other properties

Better name

swentel’s picture

Issue tags:+Field API

Tagging

xjm’s picture

Or, @yched suggested making it explicitly a boolean, TRUE or FALSE, instead of 0 or 1.

yched’s picture

Un-postponing.

yched’s picture

Status:Postponed» Active
andypost’s picture

Also each Configurable has public $status property and default Enable/Disable actions that used by views only, related issue is #1965910: Remove enable/disable entity operations
Change notice http://drupal.org/node/1926376

xjm’s picture

I still consider #1965910: Remove enable/disable entity operations a wontfix, and the status flag is also relevant to filters, blocks, etc.

swentel’s picture

Status:Active» Needs review
StatusFileSize
new5.07 KB
PASSED: [[SimpleTest]]: [MySQL] 54,483 pass(es).
[ View ]
yched’s picture

Status:Needs review» Reviewed & tested by the community

Looks fine :-)

swentel’s picture

If this one goes in first, #1942346: Convert Field API variables to CMI needs a re-roll.

andypost’s picture

Status:Reviewed & tested by the community» Needs review
StatusFileSize
new12.58 KB
PASSED: [[SimpleTest]]: [MySQL] 54,483 pass(es).
[ View ]
new8 KB

Suppose better to include more places

yched’s picture

Status:Needs review» Reviewed & tested by the community

Even better :-)

andypost’s picture

StatusFileSize
new14.6 KB
PASSED: [[SimpleTest]]: [MySQL] 54,495 pass(es).
[ View ]
new2.03 KB

And 2 more places

webchick’s picture

Title:Add a constant OR use TRUE/FALSE for active storage vs. inactive storage and other properties» Change notice: Add a constant OR use TRUE/FALSE for active storage vs. inactive storage and other properties
Priority:Normal» Critical
Status:Reviewed & tested by the community» Active
Issue tags:+Needs change record

This looks like good clean-up.

Committed and pushed to 8.x. Thanks!

I *think* this needs a change notice?

yched’s picture

Priority:Critical» Normal
Status:Active» Fixed
Issue tags:-Needs change record

I don't think a change notice is needed, this is only improving consistency on existing code by filling actual booleans instead of "various things that are == to TRUE or FALSE" on values that are treated as booleans by the API.

But there is no API change underneath, the underlying code makes no additional checks on those values being strict booleans, and there is no intention of doing so (none of core does).

Closing for now, but feel free to correct me.

swentel’s picture

Title:Change notice: Add a constant OR use TRUE/FALSE for active storage vs. inactive storage and other properties» Add a constant OR use TRUE/FALSE for active storage vs. inactive storage and other properties

Adjusting title

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