Steps to reproduce
After installing v2.0.x-dev and running drush cron, the error shows in the console and the page does not load:
Error: Call to undefined function Drupal\materialize\file_scan_directory() in Drupal\materialize\Theme->fileScan() (line 327 of /Users/.../public_html/themes/contrib/materialize/src/Theme.php).
Proposed resolution
Commenting out line 327 in src/Theme.php ($files->set($hash, file_scan_directory($path, $mask, $options));) solved the issue.
Remaining tasks
Why is this function undefined and/or why is setting the hash needed?
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | set_func_materilize.patch | 707 bytes | forbich |
Issue fork materialize-3240387
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
Comment #4
mohit.bansal623 commentedPlease review the merge request.
Calling service for filesystem.
Comment #5
igel commented@mohit.bansal623 Applying your fix, I still get the error:
Error: Call to undefined method Drupal\Core\File\FileSystem::file_scan_directory() in Drupal\materialize\Theme->fileScan() (line 327 of themes/contrib/materialize/src/Theme.php).Comment #6
denes.szabo commentedThe problem is: the file_scan_directory() deprecated in D9.
https://api.drupal.org/api/drupal/core%21includes%21file.inc/function/fi...
I fixed a problem in the dev branch. Check it, pls.
Comment #7
igel commentedThank you for the fix. However, it created a new error:
Error: Call to a member function set() on array in Drupal\materialize\Theme->fileScan() (line 336 of themes/contrib/materialize/src/Theme.php).Comment #8
igel commentedComment #9
forbich commentedAdded temporary patch to continue work at projects.
Comment #10
denes.szabo commentedJust committed a fix for this issue: https://git.drupalcode.org/project/materialize/-/commit/9f931497de96d972...
You can check it now.