Workspace manage page does not allow for pager-less list of changes

Created on 18 February 2025, 3 months ago

Problem/Motivation

In #3273461: Add pagination to the workspace manage page β†’ , there was a pager added to the Workspace manager view page, to allow paging thru a long set of changes in a workspace.

The interface \Drupal\workspaces\WorkspaceAssociationInterface::getTrackedEntitiesForListing seems to allow to pass false for the limit, which should show all items, without a pager, IIUC. However, if you pass false, then no items display in that table, and you see this error:

Warning: foreach() argument must be of type array|object, null given in Drupal\workspaces\WorkspaceAssociation->getTrackedEntitiesForListing() (line 183 of core/modules/workspaces/src/WorkspaceAssociation.php).
Drupal\workspaces\WorkspaceAssociation->getTrackedEntitiesForListing() (Line: 96)
Drupal\workspaces\WorkspaceViewBuilder->buildComponents() (Line: 282)
Drupal\Core\Entity\EntityViewBuilder->buildMultiple() (Line: 239)
Drupal\Core\Entity\EntityViewBuilder->build()

(For background, I found this problem while providing an alternate entity view builder for Workspaces.)

Steps to reproduce

- Install Drupal 11.1.2 with Standard profile
- Enable workspaces and workspaces_ui modules
- Add at least one change in a workspace.
- Change \Drupal\workspaces\WorkspaceViewBuilder::$limit to false.
- View the workspace.
- Notice that you do not see your changes, but you should see an error message.

See screenshot example:

Proposed resolution

Update \Drupal\workspaces\WorkspaceAssociation::getTrackedEntitiesForListing to handle false for the pager limit, which should query for all changes, not using a pager at all.

Remaining tasks

Add test?

User interface changes

None

Introduced terminology

None

API changes

None

Data model changes

None

Release notes snippet

TODO

πŸ› Bug report
Status

Needs work

Version

11.1 πŸ”₯

Component

workspaces.module

Created by

πŸ‡ΊπŸ‡ΈUnited States krisahil

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024