Formfeed-UK / nova-dependable-panel

A Nova 4 Panel that allows DependsOn Functionality
MIT License
7 stars 7 forks source link

Issue with BelongsTo and MorphTo Relationships Inside DependablePanel in Laravel Nova 4 #9

Open SubniC opened 9 months ago

SubniC commented 9 months ago

Hello,

I am currently integrating DependablePanel. The package has been functioning well in terms of dependencies and compatibility with my Laravel and Nova versions. However, I've encountered an issue related to relationship fields.

Environment:

Issue Description: When I encapsulate BelongsTo or MorphTo relationship fields within the DependablePanel container, these fields do not load their respective values. Conversely, when these relationship fields are placed outside of the DependablePanel container, they function as expected and load values without any issues.

Steps to Reproduce:

  1. Create a basic Nova resource with no additional fields except for the ones mentioned.
  2. Add BelongsTo or MorphTo relationship fields inside a DependablePanel container.
  3. Observe that the relationship fields do not load their values when placed inside the container.
  4. Move the relationship fields outside the DependablePanel container and note that they now correctly load their values.

Expected Behavior: Relationship fields such as BelongsTo and MorphTo should load their values correctly even when placed inside the DependablePanel container, maintaining consistency with their behavior outside the container.

Actual Behavior: BelongsTo and MorphTo relationship fields fail to load their values when nested inside a DependablePanel container, although they work as intended when placed outside of it.

I am looking forward to any guidance or updates regarding this issue. Please let me know if further information or clarification is needed.

Thank you for your assistance.

Best regards, Miguel

scramatte commented 6 months ago

Hi,

Same issue here, please fix

Regards

scramatte commented 6 months ago

Note that if you clone the field and you put one in the dependable and another one outside it works...

scramatte commented 6 months ago

The issue is related to Http/Controllers/AssociatableController This class call availableFields method that returns only first level fields and doesn't returns fields contained into panels. So a 404 is triggered. It looks tricky to be able to solve this