file upload not working

Created on 23 April 2025, 25 days ago

Problem/Motivation

I have two problems when I try to fill the config form of the module:
- I can not upload the api json file in Drupal 11.
- I have two application one iOS and one android It appears that you can fill only one application id.
- Send to multiple device at one I have over 55000 people in my backend is it possible to send the notification to multiple user at onse.

Steps to reproduce

go to /fr/admin/config/services/firebase-ui and fill the form:
- The last step is a upload file field and it doesn't work on Drupal 11.
- The form appId field appears tho accept only one value. Is that the case?
The queue appears to send notification one by one is that the case?

Proposed resolution

change the file validator part of your form from:

 '#upload_validators' => [
        'file_validate_extensions' => ['json'],
      ],

to:

 '#upload_validators' => [
        'FileExtension' => ['json'],
      ],

- is is possible to allows multiple values for the appId field.
- is it possible to send the notfication to an array of firebase token instead of one by one?

🐛 Bug report
Status

Active

Version

1.0

Component

User interface

Created by

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

Comments & Activities

  • Issue created by @jeremyvdm
  • 🇮🇳India pirtpal_singh Ludhana

    Thank you for your submission and thoughtful feedback.

    Just a quick clarification on the file validator:

    file_validate_extensions is the correct and Drupal-supported validator for #managed_file elements. The suggested FileExtension refers to a Symfony constraint class and is not applicable within Drupal’s Form API. Using it would result in validation issues.

    That said, I appreciate you raising this and will review the file upload issue on Drupal 11 in more detail to ensure full compatibility. In the next release cycle, I’ll also consider your other suggestions around multi-app ID support and batching notifications for large-scale delivery.

    Thanks again for contributing — looking forward to improving this together!

  • 🇮🇳India pirtpal_singh Ludhana

    Thank you for reporting these issues and sharing your suggestions.

    Latest Updates

    1. JSON File Upload in Drupal 11

    This issue has been resolved. The module was originally tested up to Drupal 10, and the file upload validator used was incompatible with Drupal 11. As suggested, the upload validator has been updated to:

    '#upload_validators' => [
      'FileExtension' => ['json'],
    ],
    

    2. Support for Multiple Application IDs

    Currently, the form supports only a single application ID. I recognize the need to accommodate both iOS and Android app IDs and will consider this for a future release.

    3. Sending Notifications to Multiple Devices

    Firebase doesn’t allow sending to an array of tokens in one request via the current API, so notifications are queued and sent individually. However, I’m actively researching better ways to handle high-volume delivery more efficiently.

    4. Multiple appId Values in Config Form

    This is a valid feature request. I will explore adding support for multiple values in the appId field in future updates.

    Thanks again for your detailed feedback — it's incredibly helpful in improving the module’s quality and usefulness.

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

Production build 0.71.5 2024