Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/bug-fix: add maxParallelUploads option to FileUpload component #15309

Merged

Conversation

angus-mcritchie
Copy link

Description

This pull request adds a maxParallelUploads() method to control how many parallel uploads happen at once.
Although this is a useful method by itself, it also allows a simple workaround for #15308

Visual changes

There are no visible changes except for the documentation, which is highlighted in red.

image

Functional changes

  • [ x] Code style has been fixed by running the composer cs command.
  • [ x] Changes have been tested to not break existing functionality.
  • [ x] Documentation is up-to-date.

@danharrin danharrin added the enhancement New feature or request label Jan 10, 2025
@danharrin danharrin added this to the v3 milestone Jan 10, 2025
Copy link
Member

@danharrin danharrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code is perfect, thank you very much for adhering to the style of the rest of the codebase

packages/forms/docs/03-fields/09-file-upload.md Outdated Show resolved Hide resolved
@danharrin danharrin merged commit 9416993 into filamentphp:3.x Jan 10, 2025
10 checks passed
@Tigla
Copy link

Tigla commented Jan 10, 2025

After these changes I get an error:

Undefined variable $getMaxParallelUploads (View: /vendor/filament/forms/resources/views/components/file-upload.blade.php)

A field without multiple uploads.
What could this be related to?

@danharrin
Copy link
Member

Could you create a reproduction repository please? I can't imagine why that would be the case.

@Tigla
Copy link

Tigla commented Jan 10, 2025

Sorry, the reason is not in these changes, but in another package that substitutes the source classes, as a result of which this error occurs: joshembling/image-optimizer#38

@DevMushref
Copy link

All my forms that has file uploads got this error: Undefined variable $getMaxParallelUploads

@xkakjd88178
Copy link

I’m having this error too.

@danharrin
Copy link
Member

Could you create a reproduction repository please? I can't imagine why that would be the case.

@bytemewebdev
Copy link

I ran composer update, then I got this error

@devSviat
Copy link

devSviat commented Jan 13, 2025

After the update, I encountered the error "Undefined variable $getMaxParallelUploads" in all forms that involve file uploads, including the Import action.

Update: The issue was resolved by removing the "joshembling/image-optimizer" package.

@danharrin
Copy link
Member

It does seem like this plugin is causing the issues. It is using the Filament file upload view, but not extending the BaseFileUpload, so any time we add new methods to the view it will break. The plugin should probably extend the class, or copy the view into the plugin so that it does not matter.

@bytemewebdev
Copy link

Anyone got a workaround?

@DevMushref
Copy link

Anyone got a workaround?

Remove joshembling/image-optimizer from your composer.json and run composer update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

7 participants