Problem/Motivation

In Drupal 9, attempting to save the settings form located at /admin/commerce/pos/settings results in a fatal error:
Error: Call to undefined function Drupal\commerce_pos\Form\file_prepare_directory() in Drupal\commerce_pos\Form\CommercePOSSettingsForm->submitForm()

Steps to reproduce

  1. Install Commerce POS in Drupal 9
  2. Navigate to POS settings page at /admin/commerce/pos/settings
  3. Make a change and attempt to save the page

You should see a fatal error.

Proposed resolution

As per https://www.palantir.net/rector/updating-deprecated-filepreparedirectory..., references to the deprecated file_prepare_directory() function should be replaced with \Drupal::service('file_system')->prepareDirectory($directory, $options);.

Remaining tasks

Test patch (coming in next comment)

User interface changes

None

API changes

None

Data model changes

None

Comments

amklose created an issue. See original summary.

amklose’s picture

Here's a patch that replaces the deprecated call in CommercePOSSettingsForm.php

amklose’s picture

Status: Active » Needs review

Changing status.

ppblaauw’s picture

The patch works for me

luksak’s picture

Status: Needs review » Reviewed & tested by the community

Works for me. Thank you!

_gramur’s picture

This works for me as well.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

  • alexpott committed 379a277f on 8.x-2.x authored by amklose
    Issue #3260249 by amklose: Call to deprecated function...

Status: Fixed » Closed (fixed)

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