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.

Command icon 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

trackleft2 created an issue. See original summary.

trackleft2’s picture

Issue summary: View changes
trackleft2’s picture

Status: Active » Needs review
trackleft2’s picture

Note 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

trackleft2’s picture

Issue summary: View changes
joegraduate’s picture

MR looks good to me.

trackleft2’s picture

Adding static patch

trackleft2’s picture

StatusFileSize
new9.93 KB

Changed the file name of the patch.

trackleft2’s picture

StatusFileSize
new579 bytes

Adding static patch with just the fix and no tests.

danahertzberg’s picture

I tested these changes and all seems to be working as expected now. I approve, thank you!

scott_euser made their first commit to this issue’s fork.

scott_euser’s picture

Status: Needs review » Fixed

Thank you! Gave this a manual test run, rebased into MR and pipeline all green now too. Merging. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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