Deprecated function: trim(): Passing null to parameter

Created on 8 December 2023, about 1 year ago
Updated 16 December 2023, about 1 year ago

After save admin/structure/feeds/add

Deprecated function: trim(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\feeds\Feeds\Fetcher\Form\UploadFetcherForm->validateConfigurationForm() (line 85 of /var/www/evropakipr/d10.evropakipr.com/modules/contrib/feeds/src/Feeds/Fetcher/Form/UploadFetcherForm.php)

Solution \src\Feeds\Fetcher\Form\UploadFetcherForm.php https://www.php.net/manual/en/function.trim.php#128441

  public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
    $values =& $form_state->getValues();

    //$values['allowed_extensions'] = preg_replace('/\s+/', ' ', trim($values['allowed_extensions']));
    $values['allowed_extensions'] = preg_replace( '/\s+/', ' ', trim($values['allowed_extensions']) ?? '' );

Drupal:10.1.7 PHP:8.2.13

🐛 Bug report
Status

Closed: duplicate

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024