Closed april-zeus closed 8 months ago
I had same issue. It crashes in repeatable field.
Hey @april-zeus and @kamil3658
I tried to reproduce the issues you mentioned and I wasn't able to.
I receive the expected input in the request:
[ // Date_range
'name' => 'start_date,end_date', // a unique name for this field
'label' => 'Date Range',
'type' => 'date_range',
'tab' => 'Time and space',
],
Can you check if you have that field overwritten in your resources/views/vendor/backpack/pro/fields/date_range.blade.php
?
If you do it's possible that you didn't get the updated files (even if you updated backpack/pro), because if there is a developer field in app resources, we will always use that instead of the package file.
If I recall correctly this was a previous issue that we fixed.
Also note that if you changed your date/locale preferences in config, you may need to update the field to display accordingly, have a look at field extra options if any are needed in your cases: https://backpackforlaravel.com/docs/6.x/crud-fields#date_range-pro
Cheers
@pxpm thank you for responding. I did some more digging. I created a new project just to be sure my old project doesn't influence this behavior in any way, and I was able to recreate this issue. It appears only update action has this problem, create operation works just fine.
In previous version of backpack we had repeatable field saved in database as json. I think data type may be a problem.
To make it easier, I created a repo with an example project https://github.com/april-zeus/example-backpack Please note those files:
app/Http/Controllers/Admin/PromoBarsCrudController.php
app/Models/PromoBars.php
Thanks @april-zeus really appreciate. A reproduction repo and all clap clap, you will spoil me 🙏
I will pull the repo in tomorrow and give it a try and come back to you with my findings 👍
Thanks again 🙏
Hey @april-zeus thank you very much for the reproduction repo, I was testing the field in the wrong place in my first attempt to reproduce it. I was able to easily reproduce the issue in your repo and I've already released backpack/pro v2.1.2 with the fix.
It should take a little bit of time for our private repository to pick the new released version, and then you should be able to get the fix with a composer update backpack/pro
.
Thanks again for raising the issue and helping in the debug 🙏
Cheers
Bug report
What I did
I updated from backpack 5 to 6.
In my CrudController with repeatable field, I have those fields
What I expected to happen
I expected to have a date range field in CRUD and data passed from frontend to backend this way:
What happened
Data got passed this way
What I've already tried to fix it
Bug occurs only with date_range in repeatable.subfields. It works fine as a separate field. I've tried updating packages
Is it a bug in the latest version of Backpack?
After I run
composer update backpack/crud
the bug... is it still there? YesBackpack, Laravel, PHP, DB version
When I run
php artisan backpack:version
the output is: