Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Over at #2137095-40: Should supported releases be shown on downloads table even if it contains insecure modules? If so, how? webchick pointed out that we lost the color-coded rows in the release node table listing all the contents of a packaged release. So, d.o distribution releases no longer give you a quick visual cue as to the status of all the included projects being bundled into the distro. This was originally added via #645074: Provide mechanism to color-code the rows in various tables based on a field in the view but apparently was somehow lost during the d.o D7 porting.
Comment | File | Size | Author |
---|---|---|---|
#10 | project_2114375-10.patch | 3.52 KB | dokumori |
#8 | 2152549-6-8.interdiff.txt | 1.32 KB | dokumori |
#8 | project_2114375-8.patch | 3.52 KB | dokumori |
#6 | project_2114375-6.patch | 3.53 KB | dokumori |
#3 | project_2114375-3.patch | 4.69 KB | dokumori |
Comments
Comment #1
dokumori CreditAttribution: dokumori commentedFor reference: this colour-coding is preserved in this dev site - example: https://test-drupal.redesign.devdrupal.org/node/2114375
Comment #2
drummA good way to implement this may be something like
project_issue_preprocess_views_view_table()
fromproject_issue
module. That adds the classes for row coloring on issue queue pages.We don't necessarily need an img tag. There are already words, so this is accessible.
Comment #3
dokumori CreditAttribution: dokumori commentedThank @drumm. Based on your recommendation, I've made the following changes:
1. implemented hook_preprocess_views_view_table() in project_package.module to inject css classes dynamically for colouring the row
2. updated the view 'project_package_local_items' to inject css classes dynamically to add the icons
3. added a css file (project_package.css) for styling the table
FYI:
1) I didn't make changes intentionally, but as the patch shows, relationship for the update status field has been undone. If I keep this, the results will go crazy i.e. all items will be marked as 'not secure' or 'update available'... The current config works as expected on the dev site (https://sprint10-drupal.redesign.devdrupal.org/node/837736/release )
2) Also on the dev site, I get the error Fatal error: Call to undefined function project_release_compatibility_list() #1822476: Fatal error: Call to undefined function project_release_compatibility_list() when I access project pages. This happens even before applying this patch, but just so you know...
Comment #4
tvn CreditAttribution: tvn commentedComment #6
dokumori CreditAttribution: dokumori commentedOk, rolled the patch against 7.x-2.x branch. My previous branch was based on the tag 7.x-2.0-unstable1 and the weirdness 1) and 2) I reported in #3 no longer exists.
Comment #7
drummLooks good. A couple small things:
drupal_clean_css_identifier(drupal_strtolower())
instead ofcheck_plain(...)
for CSS classes.white-space: nowrap;
necessary? It is good to keep module CSS as light as possible. We can always add site-specific CSS to our theme.Comment #8
dokumori CreditAttribution: dokumori commentedThanks for the swift review and response @drumm.
check_plain()
has been replaced bydrupal_clean_css_identifier(drupal_strotolower())
.check_plain()
was actually used inproject_issue_preprocess_views_view_table()
so that should be taken care of as well ;)white-space: nowrap;
is indeed unnecessary. It's a remnant from last night when I was trying to figure out the best way to add the iconsThe attached patch has these points fixed and also been tested on dev.
Comment #9
dokumori CreditAttribution: dokumori commentedoops
Comment #10
dokumori CreditAttribution: dokumori commentedSorry, found an unnecessary whitespace in line 38. Re-rolled.
Comment #12
drummLooks good. Deploying will need a full cache clear for the new CSS, changed View, and added hook implementation.
Comment #13
drummNow deployed.