Problem/Motivation

We have a lot of "sitewide alert" contents, and by default, the sorting is "most recent at the end", which is not convenient. And there is no "last modified" column, so we can't change the sorting order.

Proposed resolution

Add a "last modified" column, and allow sorting by ascending or descending order on this column.
Maybe using by default a view instead of a custom list builder would be more convenient, allowing users to fully customize the listing.

Provide an admin View so that "last modified" column or other columns can be added and sorting can be configured by the users.

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

clemorphy created an issue. See original summary.

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

batigolix’s picture

Assigned: Unassigned » batigolix
batigolix’s picture

Issue tags: +finalist-sprint
StatusFileSize
new97.12 KB
new96.97 KB

Maybe using by default a view instead of a custom list builder would be more convenient, allowing users to fully customize the listing.

Agree with this idea.

I'll work on a view that provides the same functionality as the custom list builder.

batigolix’s picture

batigolix’s picture

Assigned: batigolix » Unassigned
Status: Active » Needs review

This adds a view that provides the same functionality as the custom list builder. It also removes the list builder.

smustgrave’s picture

Status: Needs review » Needs work

This broke a number of tests appears, also doesn't have coverage for the change itself.

batigolix’s picture

I fixed the issue that caused the tests to fail.

My proposed change converts the custom list builder to a view with the same functionality (and it also removes the list builder).

So I actually did not create a Last Modified column as initially proposed in this issue. This column can be added now that the list is a view.

I added a test for the list (view) mainly focusing on the custom views fields.

batigolix’s picture

Status: Needs work » Needs review
batigolix’s picture

Title: Add a "last modified" column in the content listing table » Convert custom list to View so that columns like "last modified" can be added
Issue summary: View changes
smustgrave’s picture

Version: 3.0.1 » 3.1.x-dev
Status: Needs review » Needs work

Pinged the main Mainer but some feedback

This will need to target 3.1.x
Annotations should be replaced with attributes
Don’t think we need text claiming AI generated but good to announce it here
I’m not 100% we should delete the view builder. Pretty sure node for example if views isn’t installed falls back to a view builder.

smustgrave’s picture

Pushed up some changes I mentioned in #12

smustgrave’s picture

Status: Needs work » Needs review

@batigolix thoughts?

batigolix’s picture

Issue tags: -finalist-sprint

I think this indeed the best approach. It allows users to customize the list (as requested in this issue) if they have Views enabled. I will edit the issue description so that it reflects the latest changes.

I rephrased the documentation a bit so that it is clear that the view is optional.

I tested this manually: without views /admin/content/sitewide_alert shows the custom list. After enabling views, /admin/content/sitewide_alert shows a view. I can also add a column "Changed"

This can be reviewed by others.

batigolix’s picture

Title: Convert custom list to View so that columns like "last modified" can be added » Provide admin View so that columns like "last modified" can be added
Issue summary: View changes
smustgrave’s picture

Status: Needs review » Fixed

All feedback for this one has been addressed.

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.

smustgrave’s picture

Goofed and merged to 3.0.x vs 3.1.x, reverted that and pushing to 3.1.x will merge once green.

Status: Fixed » Closed (fixed)

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

claudiu.cristea’s picture

This adds a view in config storage with no UUID

claudiu.cristea’s picture

Steps:

Updated the project to 3.1.0.
Ran drush updb -y
Exported the config. I can see views.view.sitewide_alert_admin.yml has been created but lacks uuid

When I install the site from config, I'm getting:

> [2026-03-23T12:41:40.393803+01:00] php.WARNING: Warning: Undefined array key "uuid" in Drupal\Core\Config\StorageComparer->addChangelistUpdate() (line 303 of /var/www/html/web/core/lib/Drupal/Core/Config/StorageComparer.php)
#1 /var/www/html/web/core/lib/Drupal/Core/Config/StorageComparer.php(303): _drupal_error_handler() #2 /var/www/html/web/core/lib/Drupal/Core/Config/StorageComparer.php(247): Drupal\Core\Config\StorageComparer->addChangelistUpdate()
#3 /var/www/html/web/core/lib/Drupal/Core/Config/StorageComparer.php(413): Drupal\Core\Config\StorageComparer->createChangelist()
#4 /var/www/html/web/core/lib/Drupal/Core/Config/ConfigImporter.php(659): Drupal\Core\Config\StorageComparer->reset() #5 
...
claudiu.cristea’s picture

I've tried to add a fix but it seems the function in only in 3.1.0 but not in 3.1.x. Weird EDIT: It was an outdated branch

claudiu.cristea changed the visibility of the branch 3561256-followup to hidden.

claudiu.cristea changed the visibility of the branch 3561256-followup to active.

claudiu.cristea’s picture

Opened https://git.drupalcode.org/project/sitewide_alert/-/merge_requests/103 which fixes the issue. I cannot set to "Needs review" could you check and do a new release? Thank you