Problem/Motivation
I am attempting to override a view with an offset value of 4 with 0 to show all results starting from zero.
Steps to reproduce
Create a view, set an offset value.
Reference the view and override the offset with 0
Notice that the offset is not overridden.
This is because is_empty translates 0 as true.
Proposed resolution
Instead of checking is_empty, check is_numeric.
Additionally, update test view with an offset so it can be overridden.
Add tests for offset functionality.
Remaining tasks
User interface changes
0 offsets now override the offest in the referenced view.
API changes
0 offsets now override the offest in the referenced view.
Data model changes
0 offsets now override the offest in the referenced view.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 3494566-10-allow-overriding-offset-with-0-value.patch | 579 bytes | trackleft2 |
Issue fork viewsreference-3494566
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
trackleft2Comment #4
trackleft2Comment #5
trackleft2Note that in the test-only changes job that overriding offset with a 0 value doesn't work.
https://git.drupalcode.org/issue/viewsreference-3494566/-/jobs/3736597
Comment #6
trackleft2Comment #7
joegraduateMR looks good to me.
Comment #8
trackleft2Adding static patch
Comment #9
trackleft2Changed the file name of the patch.
Comment #10
trackleft2Adding static patch with just the fix and no tests.
Comment #11
danahertzberg commentedI tested these changes and all seems to be working as expected now. I approve, thank you!
Comment #14
scott_euser commentedThank you! Gave this a manual test run, rebased into MR and pipeline all green now too. Merging. Thanks!