-
Notifications
You must be signed in to change notification settings - Fork 915
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
modifyField()
does not call the defined macros in the modifications
#5352
Comments
Hello there! Thanks for opening your first issue on this repo! Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that. Backpack communication channels:
Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch. Thank you! -- |
The Backpack\CRUD\app\Library\CrudPanel\Traits\Fields@hasUploadFields check that the field has the upload attribute as true value. If we add it in the What do you think ? |
Hey @dimer47 thanks for the report and the additional information. I think I got the issue here. The I am not sure about the real intent of it, I am guessing that by the time it was added (very long time ago), was to don't rely on the field types to add the enc-type. Behind the scenes the The Uploader macro is activated with The macros should not be ran on Your scenario would work just fine if you do: CRUD::setFromDb();
CRUD::field('path')->withFiles(); Let me know if it worked for you. Cheers |
Hey pxpm 👋🏻 Thanks for your return, I confirm that by doing Cheers |
Maybe I can work around it by checking if the field don't contain the macro in the previous attributes, only in the ones provided by It may work non-BC like that. I will investigate that possibility. I don't think at the moment we have a way to run a specific macro on the field, either I can't prioritize this rigth now, but I will keep this open so I don't forget. Thanks again for the report 🙏 |
modifyField()
does not call the defined macros in the modifications
Bug report
What I did
By using
setFromDb()
and modifying the type of a field toupload
with themodifyField
function the form does not apply the enctype.What I expected to happen
The
modifyField
method should add the enctype to the form if it is an upload, upload_multiples, image, ... type.What happened
Currently, the form does not send the file in POST request.
What I've already tried to fix it
If we rewrite the field with
CRUD::field
instead of modifying it withCRUD::modifyField
it works and the enctype is definedIs it a bug in the latest version of Backpack?
This is indeed the latest version of Backpack v6 and I confirm after running ``composer update backpack/crud``` the bug is still there.
Backpack, Laravel, PHP, DB version
When I run
php artisan backpack:version
the output is:BACKPACK PACKAGE VERSIONS:
backpack/basset: 1.2.1
backpack/crud: 6.2.4
backpack/devtools: 3.0.0
backpack/editable-columns: 3.0.2
backpack/generators: v4.0.2
backpack/logmanager: v5.0.1
backpack/pro: 2.0.16
backpack/settings: 3.1.0
backpack/theme-tabler: 1.1.1
The code:
The text was updated successfully, but these errors were encountered: