Problem/Motivation

We are using file_validate functions in MarkerIconService.php:

    $this->fileUploadValidators = [
      'file_validate_extensions' => !empty($this->geofieldMapSettings->get('theming.markers_extensions')) ? [$this->geofieldMapSettings->get('theming.markers_extensions')] : ['gif png jpg jpeg'],
      'file_validate_size' => !empty($this->geofieldMapSettings->get('theming.markers_filesize')) ? [Bytes::toNumber($this->geofieldMapSettings->get('theming.markers_filesize'))] : [Bytes::toNumber('250 KB')],
    ];

But these have been deprecated in 10.2, and are removed in Drupal 11 (See https://www.drupal.org/node/3363700). This module is marked as D11 compatible, so we should replace these validations with the new Contraint plugins.

Since these new constraint plugins were introduced in 10.2, and geofield_map only works on Drupal versions from 10.2 and up, we don't need to introduce any backwards compatibility. So just replacing the code is fine.

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

gueguerreiro created an issue. See original summary.

gueguerreiro’s picture

Assigned: gueguerreiro » Unassigned
Status: Active » Needs review

Opened an MR with the fix, for review.

itamair’s picture

Status: Needs review » Fixed

Thanks @gueguerreiro, nice catch!
Already merged and deployed with new geofield_map 11.1.1 release

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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

itamair’s picture

Status: Closed (fixed) » Fixed

  • itamair committed 3f54ea16 on 11.1.x
    geofield_map_file_validate_is_image' validation removed, as not working...

Status: Fixed » Closed (fixed)

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