dcasia / conditional-container

Provides an easy way to conditionally show and hide fields in your Nova resources.
MIT License
115 stars 37 forks source link

Column not found error when using media package #53

Closed abishekrsrikaanth closed 3 years ago

abishekrsrikaanth commented 3 years ago

@milewski, I get this error when I use this nova package https://github.com/ebess/advanced-nova-media-library. Could you advice how to resolve this? I looked at previous releases where you exclude saves for certain library fields. Does the same need to be done for this as well?

milewski commented 3 years ago

Currently, I don't have a setup where I could quickly try this out, but are you able to modify these lines https://github.com/dcasia/conditional-container/blob/4ac92c2f3fd5ceacc91f11e5a650e979d1918ab9/src/ConditionalContainer.php#L278-L304 and see if it solves this issue?

abishekrsrikaanth commented 3 years ago

@milewski, do you want me to send you a PR?

milewski commented 3 years ago

If you were able to find the cause of the issue and have a fix for it please feel free to submit it 👍

chosten commented 3 years ago

Can confirm that adding this works.

!$field instanceof \Ebess\AdvancedNovaMediaLibrary\Fields\Media &&
!$field instanceof \Ebess\AdvancedNovaMediaLibrary\Fields\Files &&
milewski commented 3 years ago

Can you submit it as a PR @SquareBeard ?

chosten commented 3 years ago

I could, but I'm actually using the flexible-content branch. Are you planning to merge that branch someday ?

milewski commented 3 years ago

... That branch has some bad performance issues... I don't know if it's possible to archive compatibility with the flexible-content field in a clean way ...

chosten commented 3 years ago

I did not notice any obvious performance drop. Do you remember why ? Is it while saving or on the JS side maybe ?

chosten commented 3 years ago

Anyway here is the PR for the master branch. I've not tested it on that branch but i think there is no reason it would be different.