-
Notifications
You must be signed in to change notification settings - Fork 920
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
[v5][Summary] Not all fields work as subfields inside relationship #4109
Comments
Now let's see which ones work and which ones don't... I'll update this table as I test... My tests have been done with the following branches merged:
Legend: Can I use this field type as a subfield?
Can I use this field feature inside a subfield?
|
Priorities:
|
I'm very happy with the progress on this. I've opened issues for the few cases I think we should fix before launch. Other than that... I'm comfortable with moving this to the 4.2.x board 🎉 to make it a "problem for future us". |
Round-up. There are still a few things to be done here, to consider the issue completely closed:
|
Hi, I recently just updated my laravel backpack from 4.1 to 5, and try to add the nested repeatable under the repeatable, there is an issue here like I am not allowed to click on the nested "New Item" on the nested repeatable field, but if I create the post and edit it later, I am allowed to click on the "New Item" button and it shows the nested repeated field, is it a bug or intended? And I saw the above table it said that the repeatable are not allowed to use as a subfield, so I am confused here, it should not be working, but why it is working when I edit the post. below is my crud fields for reference. |
Hello @kee0624 . It migth display on page, but surelly it's not working. Subfields inside subfields are not supported. Some will display, some will not display and throw errors. Use at will, we do not recommend and we do not support them (for now). thanks |
Hey guys, I noticed this strange behavior |
Hello @guleswine it's indeed strange but I guess that it might be some corner case while using default values or something like that. As far as I am aware select2_from_array was working properly as a subfield. If you remove the If so, please open a separate issue so we can have a look at and don't forget about it in the middle of this thread. Thanks |
Right now, we do NOT have a clear map:
subfields
insiderepeatable
?subfields
insiderelationship
?And we should. We MUST. It's just a matter of time before somebody tries a combination we haven't - and they will get a horrible experience. If we do not tell them "X does not work as subfield", they will expect everything to work as subfields. So we need to TEST EVERYTHING, KNOW what works and what doesn't and DOCUMENT what works and what doesn't. Then, one by one, we can make them work (if it's reasonable to do so). Here's my first attempt to test EVERYTHING.
What is left untested?
subfields
insiderepeatable
field - we have them inside the Dummies CRUD ✅subfields
insiderelationship
fieldhasOne
/morphOne
) 🟨hasMany
/morphMany
) 🟨belongsToMany
/morphToMany
pivot table) 🟨So what we need to add to the Demo, to have all bases covered, are examples that use all field types as subfields, inside the yellow scenarios above. The new interfaces we just added for the
relationship
field. Fortunately, we already have a model with ALL field types. And they're already configured insideMonsterCrudController
, we can just re-use their definition like we did in Dummies CRUD.How do we test the untested?
We can add three new entities,
Cave
,Story
andHero
, with the following db tables:This means that:
hasOne
Monster (there's acave_id
on themonsters
table) - treats use case (A)hasMany
Monster (there's astory_id
on themonsters
table) - treats use case (B)hasMany
Monster (there's ahero_id
on the monsters` table, which also means:belongsToMany
Story (through themonsters
pivot table) - treats use case (C)belongsToMany
Hero (through themonsters
pivot table)- treats use case (C)So we can build three new CRUDs, to have ALL subfields tested in these 3 new use cases. I'll submit a PR to the demo with these three new CRUDs:
Update: PR here - Laravel-Backpack/demo#346
The text was updated successfully, but these errors were encountered: