Booleans are nicer to read than strings or integers.
However, this crashes Flag:
function foo_flag_default_flags() {
$flags = array();
$flags['test_flag'] = array (
'entity_type' => 'node',
'title' => 'Test flag',
'global' => FALSE,
// ...
with this error:
> General error: 1366 Incorrect integer value: '' for column 'global' at row 1: INSERT INTO {flag} (entity_type, name, title, global, options) VALUES
It would seem that the FALSE gets cast to an empty string rather than a 0.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 2059959.flag_.global-boolean.patch | 729 bytes | joachim |
Comments
Comment #1
joachim commentedI had a look at other exportables with boolean properties to see how they handle it, as casting the value to an (int) on save seemed messy.
But no, this is how node types do it:
So I guess that's how we'll do it too.
Comment #2
joachim commentedComment #3
joachim commentedTests pass. Committing.