Image upload and path don't work

Created on 14 January 2023, over 1 year ago
Updated 5 February 2024, 5 months ago

Problem/Motivation

It is not possible to change the unlocked and locked image for the achievements. Only the default ones work.
If you try to change it, WSOD with this error:

Error: Call to a member function get() on null in Drupal\achievements\Form\AchievementEntityForm->submitForm() (line 228 of modules/contrib/achievements/src/Form/AchievementEntityForm.php).

Steps to reproduce

  1. Install achievement 2.x-dev or 3.x-dev.
  2. On achievement type create a new type.
  3. Disable default image.
  4. Compile one or more of the fields related to the image.
  5. Click save.

Also tested on simplytest.me with achievement 2.x-dev and Drupal 9.5.1

๐Ÿ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡นItaly sepa_cleversoft

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • nico.b โ†’ made their first commit to this issueโ€™s fork.

  • @nicob opened merge request.
  • There actually seem to be two errors with the image upload and path.

    First, as described above,

    Error: Call to a member function get() on null in Drupal\achievements\Form\AchievementEntityForm->submitForm() (line 228 of modules/contrib/achievements/src/Form/AchievementEntityForm.php).

    appears when uploading an image. If setting the path manually, another error occurs due to the usage of deprecated/removes APIs:

    Error: Call to undefined method Drupal\Core\File\FileSystem::uriScheme() in Drupal\achievements\Form\AchievementEntityForm->validatePath() (line 209 of modules/contrib/achievements/src/Form/AchievementEntityForm.php)

    I submitted a patch (as a merge request) that should fix both issues.

    I'd appreciate a review.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States grasmash

    Related changes were made here: https://www.drupal.org/project/achievements/issues/3182487 ๐Ÿ› Form fails on drupal 9 because of non-existing method Fixed

    Is this still an issue?

Production build 0.69.0 2024