There should be a way to add to the RecursiveExtensionFilterIterator whitelist

Created on 12 August 2016, almost 8 years ago
Updated 26 April 2023, about 1 year ago

This is directly related to 📌 Ignore front end vendor folders to improve directory search performance Fixed which allows you to add items to the blacklist in RecursiveExtensionFilterIterator. I would like to similarly be able to add items to the whitelist which is used when searching the docroot during discovery.

We want the ability to have a "components" folder in the docroot which can be used to place decoupled blocks → . The components are not modules, profiles, or themes and we want them to live in their own space.

With a config option in settings.php, I could add 'components' to the whitelist so its not excluded during ExtensionDiscovery->scanDirectory()

✨ Feature request
Status

Needs work

Version

10.1 ✨

Component
Extension  →

Last updated 3 days ago

No maintainer
Created by

🇺🇸United States mrconnerton

Live updates comments and jobs are added and updated live.
  • Needs change record

    A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • The Needs Review Queue Bot → tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.

  • 🇮🇳India Nikhil_110

    Tried to apply patch drupal-file_scan_include_directories-2783389-1.patch but getting some error so I created new patch for Drupal 10.1.x

    array $whitelist = [] is replaced by array $allowedExtensionTypes = [] in __construct functions

    git apply -v drupal-file_scan_include_directories-2783389-1.patch 
    Checking patch core/lib/Drupal/Core/Extension/Discovery/RecursiveExtensionFilterIterator.php...
    error: while searching for:
       *   (optional) Add to the blacklist of directories that should be filtered
       *   out during the iteration.
       */
      public function __construct(\RecursiveIterator $iterator, array $blacklist = []) {
        parent::__construct($iterator);
        $this->blacklist = array_merge($this->blacklist, $blacklist);
      }
    
      /**
    
    error: patch failed: core/lib/Drupal/Core/Extension/Discovery/RecursiveExtensionFilterIterator.php:90
    error: core/lib/Drupal/Core/Extension/Discovery/RecursiveExtensionFilterIterator.php: patch does not apply
    Checking patch core/lib/Drupal/Core/Extension/ExtensionDiscovery.php...
    Hunk #1 succeeded at 414 (offset -19 lines).
  • last update about 1 year ago
    29,304 pass
  • Status changed to Needs review about 1 year ago
  • Status changed to Needs work about 1 year ago
  • 🇺🇸United States smustgrave

    Issue summary could use some attention.

    This will need a change record and test coverage.

Production build 0.69.0 2024