User tests: Successful: Unsuccessful:
Pull Request for Issue # .
This sets up ModuleHelper to allow integer owncache
value. This is needed in case integer filter is applied to the field in module manifest file.
Code review.
No.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
No. But $moduleparams->get('owncache', 1) == 0
would.
The loose comparison will allow any falsy value to pass. Anything in array('0', 0, null, false)
would qualify. Because our parameter typing in core is so weak (pretty much everything is a string because we have no ORM to do type conversion on DB results and unless you explicitly set filters in form configs values are strings), you still have to be a bit careful about what places you allow loose comparisons and what places you can safely make strict comparisons.
So for me, this patch is fine as is. It looks like we're looking for an explicit "turn this off" config value, so we should be strict on what gets accepted (so I wouldn't let a "param value is null" condition pass here, which a loose comparison would do).
Setting a fallback would prevent null
and empty string to pass.
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
Ready to Commit after two successful tests.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-06-20 00:32:09 |
Closed_By | ⇒ | mbabker | |
Labels |
Added:
?
|
Will this work also?
$moduleparams->get('owncache') == 0