Description
Submitted on behalf of Christ's Church of the Valley (CCV)
The Internal Communication View block (RockWeb/Blocks/Utility/InternalCommunicationView.ascx.cs) can never navigate past the two most recent content channel items, regardless of how many approved items the channel contains.
The cause is the order of Take() and Skip() when the items are queried in ShowView():
var contentChannelItems = contentChannelItemsQry.OrderByDescending( i => i.StartDateTime )
.Take( 2 )
.Skip( _currentPage )
.ToList();
Because Take(2) runs first, the query is always limited to the two newest items before the page offset is applied. On page 1 the result is a single item, so showPrev = (contentChannelItems.Count > 1) becomes false and the Previous button is hidden — every item older than the second-newest is unreachable. Page 2 would return zero rows.
Swapping the two calls fixes paging:
var contentChannelItems = contentChannelItemsQry.OrderByDescending( i => i.StartDateTime )
.Skip( _currentPage )
.Take( 2 )
.ToList();
This returns the current item plus one older item, so showPrev correctly reflects whether anything older exists.
Actual Behavior
The block shows the newest item with a Previous chevron. Clicking Previous once shows the second-newest item, and the Previous chevron disappears even though older approved items exist in the channel. Items three and beyond can never be displayed.
Expected Behavior
Clicking Previous should continue paging back through all approved, active items in the channel, one at a time, with the Previous chevron disappearing only on the oldest item.
Steps to Reproduce
- Log in to the demo site as admin and note the Internal Communication View block on the internal homepage (the news panel with previous/next chevrons, wired to the "Internal Communication" content channel).
- Ensure the channel has at least 3 items with Status = Approved and staggered past Start Dates (e.g., today, yesterday, two days ago) — add items via CMS Configuration > Content Channels > Internal Communication if needed.
- Return to the homepage. The newest item is shown with a Previous chevron.
- Click Previous once. The second item is shown and the Previous chevron disappears; the third and older items cannot be reached.
Note: the block's cache only applies to page 0, so caching does not mask the behavior.
Issue Confirmation
Rock Version
19.4
Client Culture Setting
en-US
Description
Submitted on behalf of Christ's Church of the Valley (CCV)
The Internal Communication View block (
RockWeb/Blocks/Utility/InternalCommunicationView.ascx.cs) can never navigate past the two most recent content channel items, regardless of how many approved items the channel contains.The cause is the order of
Take()andSkip()when the items are queried inShowView():Because
Take(2)runs first, the query is always limited to the two newest items before the page offset is applied. On page 1 the result is a single item, soshowPrev = (contentChannelItems.Count > 1)becomes false and the Previous button is hidden — every item older than the second-newest is unreachable. Page 2 would return zero rows.Swapping the two calls fixes paging:
This returns the current item plus one older item, so
showPrevcorrectly reflects whether anything older exists.Actual Behavior
The block shows the newest item with a Previous chevron. Clicking Previous once shows the second-newest item, and the Previous chevron disappears even though older approved items exist in the channel. Items three and beyond can never be displayed.
Expected Behavior
Clicking Previous should continue paging back through all approved, active items in the channel, one at a time, with the Previous chevron disappearing only on the oldest item.
Steps to Reproduce
Note: the block's cache only applies to page 0, so caching does not mask the behavior.
Issue Confirmation
Rock Version
19.4
Client Culture Setting
en-US