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?

CommentFileSizeAuthor
#9 set_func_materilize.patch707 bytesforbich
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

igel created an issue. See original summary.

mohit.bansal623 made their first commit to this issue’s fork.

mohit.bansal623’s picture

Status: Active » Needs review

Please review the merge request.
Calling service for filesystem.

igel’s picture

@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).

denes.szabo’s picture

Assigned: Unassigned » denes.szabo
Status: Needs review » Fixed

The 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.

igel’s picture

Thank 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).

igel’s picture

Status: Fixed » Needs work
forbich’s picture

StatusFileSize
new707 bytes

Added temporary patch to continue work at projects.

denes.szabo’s picture

Status: Needs work » Fixed

Just committed a fix for this issue: https://git.drupalcode.org/project/materialize/-/commit/9f931497de96d972...

You can check it now.

Status: Fixed » Closed (fixed)

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