Problem/Motivation

The core/misc is very messy.
There are also loads of image files in there that a no longer used anywhere in core, most of them being replaced by #2032773: Use Libricons (icon font) in Seven, consider using it more broadly in core.

Proposed resolution

Remove all image files that are no longer used and move the forum icons into the forum module.

User interface changes

None

API changes

None

Original report by @jenlampton

- Move forum-icons.png into forum module
- Consolidate use of watchdog-warning.png and message-16-warning.png and remove one
- Remove all the "powered by drupal" logos if we truly don't care about SEO for drupal.org anymore

Remaining tasks

From comment #37: Split this entire issue into separate issues focusing on discrete image file-sets

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jenlampton’s picture

Issue summary: View changes

added current location

jenlampton’s picture

Title: Move forum-icons.png into forum module » Clean up icons in misc
Component: forum.module » base system

Rather than creating a bunch of separate issues, I'll lump together all the cleanup of misc in one issue.

sun’s picture

Component: base system » markup
Issue tags: +Front end

The second is covered by #1246722: Replace or rename redundant watchdog icons already.

For the third, there's #905988: Provide "Powered by Drupal"-Icons with transparent background

Closely related: #436500: Modernize generic menu icons/arrows in /misc

I think it would make more sense to focus this issue back on the forum icons only...?

mgifford’s picture

Can any of these get replaced by #1744278: Make use of jQuery UI Icons in core?

Do we have any SVG files for the existing images?

chrisjlee’s picture

Patch moves forum icon and updates forum css

chrisjlee’s picture

Status: Active » Needs review

other issues:
- powered by drupal: Already have been removed from misc folder
- Consolidate warning and message-16.png: Not sure which to go yet. Probably the smaller message-16.png file

chrisjlee’s picture

Issue summary: View changes

add more stuff that needs cleanup in misc

LewisNyman’s picture

Issue summary: View changes

I think we could remove some of these icons now that we have #2032773: Use Libricons (icon font) in Seven, consider using it more broadly in core

LewisNyman’s picture

List of icons that are no longer referenced in core:

  • configure.png
  • configure-dark.png only in tests
  • draggable.png
  • edit.png
  • edit-active.png
  • grippie.png only in tests
  • help.png
  • loading.gif
  • menu-collapsed-rtl.png
  • menu-collapsed.png
  • menu-expanded.png
  • menu-leaf.png
  • message-16-error.png
  • message-16-help.png
  • message-16-info.png
  • message-16-warning.png
  • message-24-error.png
  • message-24-help.png
  • message-24-info.png
  • message-24-ok.png
  • message-24-warning.png
  • permissions.png

... that's I bigger list than I was expecting! I doubled checked a few of these.

mcjim’s picture

I've combined the patch in #4 with deletion of the 22 files in #7.
The patch should work: the txt file should be easier to read (made using gif diff -D).

mgifford’s picture

The bot likes it. What testing needs to happen to mark this RTBC?

sun’s picture

Issue tags: +Needs manual testing, +CSS
LewisNyman’s picture

Is someone else able to sanity check this for me?

rteijeiro’s picture

Ok, I only have found a couple of missing icons in node/add/article. I have opened a follow-up for that in #2208263: Missing icons in admin pages.

The rest is working for me. Maybe RTBC?

rteijeiro’s picture

Assigned: Unassigned » rteijeiro
Status: Needs review » Needs work

Going to re-add missing icons after discussing it with @lewisnyman.

rteijeiro’s picture

Status: Needs work » Needs review
FileSize
23.82 KB

Re-rolled patch and re-added menu-collapsed.png, menu-collapsed-rtl.png and help.png icons.

emma.maria’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs manual testing

I applied #14 and clicked through many many pages to check if there are any 404 errors for images. I also enabled 5 modules that are not enabled by default to double check them incase anything was missed. I could not find any missing image errors so the patch is good.

webchick’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs issue summary update

Could we please get an updated issue summary that explains what this patch is doing (and why)? I can't quite parse it out.

LewisNyman’s picture

Issue summary: View changes
Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs issue summary update

Ok on it. How's that?

catch’s picture

Status: Reviewed & tested by the community » Needs work

This doesn't appear to modify the test that references grippie.png?

  /**
   * Tests \Drupal\Core\Image\Image::setSource().
   */
  public function testSetSource() {
    $source = __DIR__ . '/../../../../../misc/grippie.png';
    $this->image->setSource($source);
    $this->assertEquals($this->image->getSource(), $source);
  }

nicholasruunu’s picture

FileSize
24.44 KB
628 bytes

Here you go @catch

- Drupal hero

LewisNyman’s picture

Status: Needs work » Needs review
LewisNyman’s picture

Status: Needs review » Reviewed & tested by the community

Nice one! The patch still looks good.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Ok great, thanks!

Committed and pushed to 8.x.

  • Commit fab4269 on 8.x by webchick:
    Issue #1356602 by nicholasruunu, mcjim, rteijeiro, chrisjlee |...
KevinVanRansbeeck’s picture

configure-dark.png seems to be used on the "Manage Display" page of a content type.
I am on latest git version (where the icons have been removed) and go this 404 image:

404 image

LewisNyman’s picture

Status: Fixed » Needs work

:(

mcjim’s picture

Status: Needs work » Needs review
FileSize
581 bytes

This follow-up patch restores core/misc/configure-dark.png from commit fba6f74.

LewisNyman’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
290.35 KB

Ah it wasn't in the CSS, that's maybe why it was missed. Here's a screenshot of it looking better.

rodrigoaguilera’s picture

I think menu-expanded.png deleted in fab42693f81b93b4228162021ce916ef5feb13c7 should be restored since is giving me 404s and is referenced in:

core/themes/seven/style.css:  list-style-image: url(../../misc/menu-expanded.png);
core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestTestForm.php:      '#uri' => 'core/misc/menu-expanded.png',
core/modules/locale/css/locale.admin.css:  background: transparent url(../../../misc/menu-expanded.png) left .6em no-repeat;
core/modules/system/css/system.theme.css:  background: url(../../../misc/menu-expanded.png) 0px 100% no-repeat; /* LTR */
core/modules/system/css/system.theme.css:  list-style-image: url(../../../misc/menu-expanded.png);
LewisNyman’s picture

I've confirmed the second followup patch. Both patches are RTBC.

sun’s picture

Let's revert this patch entirely, please.

It clearly looks like image filenames were grepped in .css files only.

LewisNyman’s picture

@sun That can't be it, because menu-expanded appears in css.

Are there any other files that we accidentally removed? If there aren't then it's a waste reverting it now... I'll take a look.

webchick’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs manual testing

Hm. For now, I've rolled this back, because it looks like there's at least two spots that were missed (#26 and #28). We'll need one single patch with all of the proper files moved here and there as well.

Also tagging "needs manual testing" because yeah. ;)

  • Commit 37b5f2d on 8.x by webchick:
    Revert "Issue #1356602 by nicholasruunu, mcjim, rteijeiro, chrisjlee |...
mcjim’s picture

Status: Needs work » Needs review
FileSize
22.82 KB

Grepping the codebase for references to the files in #7

  • configure.png
    grep -r configure.png . | grep -v ./.git/index | wc -l
           0
  • configure-dark.png
    grep -r configure-dark.png . | grep -v ./.git/index | wc -l
           1
  • draggable.png
    grep -r draggable.png . | grep -v ./.git/index | wc -l
           0
  • edit.png
    grep -r edit.png . | grep -v ./.git/index | wc -l
           0
  • edit-active.png
    grep -r edit-active.png . | grep -v ./.git/index | wc -l
           0
  • grippie.png
    grep -r grippie.png . | grep -v ./.git/index | wc -l
           2
  • help.png
    grep -r help.png . | grep -v ./.git/index | wc -l
           2
  • loading.gif
    grep -r loading.gif . | grep -v ./.git/index | wc -l
           0
  • menu-collapsed-rtl.png
    grep -r menu-collapsed-rtl.png . | grep -v ./.git/index | wc -l
           1
  • menu-collapsed.png
    grep -r menu-collapsed.png . | grep -v ./.git/index | wc -l
           4
  • menu-expanded.png
    grep -r menu-expanded.png . | grep -v ./.git/index | wc -l
           5
  • menu-leaf.png
    grep -r menu-leaf.png . | grep -v ./.git/index | wc -l
           0
  • message-16-error.png
    grep -r message-16-error.png . | grep -v ./.git/index | wc -l
           3
  • message-16-help.png
    grep -r message-16-help.png . | grep -v ./.git/index | wc -l
           0
  • message-16-info.png
     grep -r message-16-info.png . | grep -v ./.git/index | wc -l
           0
  • message-16-warning.png
    grep -r message-16-warning.png . | grep -v ./.git/index | wc -l
           0
  • message-24-error.png
    grep -r message-24-error.png . | grep -v ./.git/index | wc -l
           0
  • message-24-help.png
    grep -r message-24-help.png . | grep -v ./.git/index | wc -l
           0
  • message-24-info.png
    grep -r message-24-info.png . | grep -v ./.git/index | wc -l
           0
  • message-24-ok.png
    grep -r message-24-ok.png . | grep -v ./.git/index | wc -l
           0
  • message-24-warning.png
    grep -r message-24-warning.png . | grep -v ./.git/index | wc -l
           0
  • permissions.png
    grep -r permissions.png . | grep -v ./.git/index | wc -l
           0

Amended list of files not referenced

  • configure.png
  • draggable.png
  • edit.png
  • edit-active.png
  • loading.gif
  • menu-leaf.png
  • message-16-help.png
  • message-16-info.png
  • message-16-warning.png
  • message-24-error.png
  • message-24-help.png
  • message-24-info.png
  • message-24-ok.png
  • message-24-warning.png
  • permissions.png

Steps to create a new patch

Amending the 1356602-clean-up-misc-15.patch from #19, which adds/deleted/amends the following files:

  • core/misc/configure-dark.png
  • core/misc/configure.png
  • core/misc/draggable.png
  • core/misc/edit-active.png
  • core/misc/edit.png
  • core/misc/forum-icons.png
  • core/misc/grippie.png
  • core/misc/loading.gif
  • core/misc/menu-expanded.png
  • core/misc/menu-leaf.png
  • core/misc/message-16-error.png
  • core/misc/message-16-help.png
  • core/misc/message-16-info.png
  • core/misc/message-16-warning.png
  • core/misc/message-24-error.png
  • core/misc/message-24-help.png
  • core/misc/message-24-info.png
  • core/misc/message-24-ok.png
  • core/misc/message-24-warning.png
  • core/misc/permissions.png
  • core/modules/forum/css/forum.module.css
  • core/tests/Drupal/Tests/Core/Image/ImageTest.php

core/misc/grippie.png can be removed as the test in core/tests/Drupal/Tests/Core/Image/ImageTest.php is amended in this patch to point to misc/help.png instead.

The following files should not be removed for now as they are referenced in CSS or JS:

  • core/misc/configure-dark.png
  • core/misc/menu-expanded.png
  • core/misc/message-16-error.png

So, attached patch keeps those files. The following files are deleted:

  • core/misc/configure.png
  • core/misc/draggable.png
  • core/misc/edit-active.png
  • core/misc/edit.png
  • core/misc/forum-icons.png
  • core/misc/grippie.png
  • core/misc/loading.gif
  • core/misc/menu-leaf.png
  • core/misc/message-16-help.png
  • core/misc/message-16-info.png
  • core/misc/message-16-warning.png
  • core/misc/message-24-error.png
  • core/misc/message-24-help.png
  • core/misc/message-24-info.png
  • core/misc/message-24-ok.png
  • core/misc/message-24-warning.png
  • core/misc/permissions.png
sun’s picture

  1. For the files (sets) using an optional suffix, the grep needs to account for dynamic string concatenations as in the following (made up) example:

    $src = 'message-16-' . $message['type'] . '.png';
    

    E.g., like this:

    $ grep -r 'message-.*\.png' core/
    core/modules/filter/filter.api.php:  $image->setAttribute('src', base_path() . 'core/misc/message-16-error.png');
    core/modules/filter/filter.module:  $image->setAttribute('src', base_path() . 'core/misc/message-16-error.png');
    core/modules/filter/lib/Drupal/filter/Tests/FilterHtmlImageSecureTest.php:    $red_x_image = base_path() . 'core/misc/message-16-error.png';
    

    So that result is apparently correct; only message-16-error.png is used.

  2. The same applies to files (sets) like configure[-dark].png, but in those cases, only the suffix might be dynamically removed via JavaScript, which means that the name configure.png may not necessarily appear in any grep results.

  3. Specifically regarding configure[-dark].png, here the idea is that core uses -dark by default, but if a theme uses a dark/negated color scheme, then it can easily replace the referenced image in CSS to use the non-dark version (which works for negated color schemes). → configure.png is to be kept.

  4. You can get a good summary of all images referenced in /misc:

    $ grep -r '\/misc' core/
    
  5. Doing that apparently yields:

    core/modules/forum/css/forum.module.css:  background-image: url(../../../misc/forum-icons.png);
    

    ...but yet, that file is listed as unused and to be deleted in #34, so something went wrong again.

  6. Likewise:

    core/tests/Drupal/Tests/Core/Image/ImageTest.php:    $source = __DIR__ . '/../../../../../misc/grippie.png';
    
  7. Now, after looking at the patch, the last two mentioned points are addressed differently. Let's perform at least the forum-icons.png change in a separate issue (the patch for that should move/rename the existing file, instead of creating a new one).

zaporylie’s picture

I think #1356602-34: [META] Clean up icons in misc is almost perfect, but I agree that forum-icons.png should be move from core/misc to core/modules/forum/images, instead of deleting/creating new one.

sun’s picture

I wonder whether we shouldn't split this entire issue into separate issues focusing on discrete image file-sets?

That allows for proper testing + screenshots of each individual aspect; e.g., to confirm that message icons still appear correctly, or that forum icons still work correctly, etc. — It's close to impossible to ensure that with the currently taken approach.

emma.maria’s picture

Title: Clean up icons in misc » [META] Clean up icons in misc
Issue tags: +frontend
emma.maria’s picture

Issue summary: View changes
LewisNyman’s picture

Assigned: rteijeiro » Unassigned
Issue tags: -Front end

It would be good to at least clean this up a little before RC, I will try and create a few sub-issues soon.

LewisNyman’s picture

Status: Needs review » Active

This issue just keeps on giving. I've created three sub issues. Let's get them in and see how misc looks after then:
#2358675: Remove messages icons in misc
#2358683: Move forum icons into the forum module
#2358685: Remove edit and configure icons from misc

LewisNyman’s picture

We should create a change record that covers all the child issues. See https://www.drupal.org/node/2358675#comment-9377411

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

  • webchick committed fab4269 on 8.3.x
    Issue #1356602 by nicholasruunu, mcjim, rteijeiro, chrisjlee |...
  • webchick committed 37b5f2d on 8.3.x
    Revert "Issue #1356602 by nicholasruunu, mcjim, rteijeiro, chrisjlee |...

  • webchick committed fab4269 on 8.3.x
    Issue #1356602 by nicholasruunu, mcjim, rteijeiro, chrisjlee |...
  • webchick committed 37b5f2d on 8.3.x
    Revert "Issue #1356602 by nicholasruunu, mcjim, rteijeiro, chrisjlee |...

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

  • webchick committed fab4269 on 8.4.x
    Issue #1356602 by nicholasruunu, mcjim, rteijeiro, chrisjlee |...
  • webchick committed 37b5f2d on 8.4.x
    Revert "Issue #1356602 by nicholasruunu, mcjim, rteijeiro, chrisjlee |...

  • webchick committed fab4269 on 8.4.x
    Issue #1356602 by nicholasruunu, mcjim, rteijeiro, chrisjlee |...
  • webchick committed 37b5f2d on 8.4.x
    Revert "Issue #1356602 by nicholasruunu, mcjim, rteijeiro, chrisjlee |...

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev
quietone’s picture

Status: Active » Fixed

This issue was originally committed in 8.x but then reverted and work was done in child issues. All the child issue but one are complete. Therefor, closing this meta as fixed.

Thanks all!

Status: Fixed » Closed (fixed)

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

quietone’s picture

Issue tags: -Needs change record

This does have a CR, removing tag.