upgrade orchid v14 modal async data #2657
Replies: 6 comments
-
after try, I can fix the error however I have another issue and the model show #connection: null, anyone know what happen? |
Beta Was this translation helpful? Give feedback.
-
I have the same problem. My modal with async does not load the data anymore since I upgraded to v14. |
Beta Was this translation helpful? Give feedback.
-
Just checked whats happening The async class is trying to load the hole layout of the page it's implemented in instead of the async part only. @tabuna is this a bug in v14 or is there a reason why it requires all models of the page even when the modal itself requires only one model? |
Beta Was this translation helpful? Give feedback.
-
Hi,
i faced the issue many times even in previous versions.
I realized that `…->layout()` with a `modal` tries to build everything even if it should make only the `async` part…
So i just set a flag in order to skip everything but the modal part of `…->layout()` if it’s an async call.
Hope it helps.
Enrico Possenti
+39 349 33 24 498
***@***.***
https://diapason.digital/

… On 26 Jun 2023, at 12:02, Christian ***@***.***> wrote:
Just checked whats happening The async class is trying to load the hole layout of the page it's implemented in instead of the async part only.
For me it's an order detail page, showing order and order item data. My modal is on order item level. So I'm passing the order item ID which was always working.
The async call fails because it try's to render the layout method of the hole order detail page which ofc fails since it's missing the order ID. As an ugly workaround I added the order ID to the async call and thats working.
@tabuna <https://github.com/tabuna> is this a bug in v14 or is there a reason why it requires all models of the page even when the modal itself requires only one model?
—
Reply to this email directly, view it on GitHub <#2657 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AABIMTKARPEZJ72YTXZIKMDXNFMZXANCNFSM6AAAAAAZRUCBLE>.
You are receiving this because you are subscribed to this thread.
|
Beta Was this translation helpful? Give feedback.
-
With ->layout() you mean the method were you put your content? I'm not sure about the last v13 versions but I'm sure the async call was working in earlier v13 versions , without any workarounds. |
Beta Was this translation helpful? Give feedback.
-
Just a sample, in a Screen:
public function layout(): array
{
$conditionToSkipItems = CONDITION_TO_CHECK_WE_ARE_IN_MODAL;
$modals = array_filter([
Layout::modal(‘MyModal', [
MyModalLayout::class,
])
]);
if ($conditionToSkipItems) return (array) $modals;
return array_merge($modals, array_filter([
OtherNonModalLayout::class,
]));
}
Enrico Possenti
Consulenza e Sviluppo IT
------------------------------------------------------------------------
FASCIA DI REPERIBILITÀ Lun-Ven > 9:00 / 13:00
------------------------------------------------------------------------
email ***@***.***
mobile +39.349.3324498
sede loc. il lato, castelmaggiore 56011 calci (pi)
… On 26 Jun 2023, at 16:58, Christian ***@***.***> wrote:
With ->layout() you mean the method were you put your content?
With a flag you mean in the async call? So if that flag is set, you put the layout content in a flag condition check? Similar ugly workaround like passing the other not required but still required params.
—
Reply to this email directly, view it on GitHub <#2657 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AABIMTPAXC2G4WUOVSMQZMDXNGPSTANCNFSM6AAAAAAZRUCBLE>.
You are receiving this because you commented.
|
Beta Was this translation helpful? Give feedback.
-
I'm upgrading orchid to v14 but all modal that I use with async fail.
Beta Was this translation helpful? Give feedback.
All reactions