Open moskoweb opened 12 months ago
From the new tests I did, it seems that the problem is using Layout::block
and Layout::rows
inside the component to be reused, before the update it worked, and now it seems that it is no longer allowed.
Getting it working again, but I don't think that's the best way to handle this problem.
I noticed that when creating the new element and calling the fields
function, it returns an array
, and when calling the index 0, it solves the problem. It seems that when calling the Component that the children are not just form fields, this error occurs.
(new FormTrackingLayout())->fields()[0],
However, this way, the Query
from Screen
is not passed on to the component.
Had a similar problem after upgrading from 14.4.0 to 14.6.0
Hi there. I wanted to let you know that I have been working on reproducing the problem you reported, but unfortunately, I haven't been successful in encountering the issue.
In my attempt to recreate the problem, I followed the instructions https://orchid.software/en/docs/rows/#reusing-layouts and implemented the code:
public function layout(): iterable
{
return [
new AddressLayout('order.shipping_address', 'Shipping Address'),
new AddressLayout('order.invoice_address', 'Invoice Address'),
];
}
I executed the code and found no errors. I also attempted using the code wrapped in a group:
public function layout(): iterable
{
return [
Layout::block([
new AddressLayout('order.shipping_address', 'Shipping Address'),
new AddressLayout('order.invoice_address', 'Invoice Address'),
]),
];
}
Even after trying this alternative option, I encountered no errors or issues.
Therefore, it would be extremely helpful if you could provide additional information so that I can better understand the problem and assist you in resolving it. Please let me know if there's anything else you'd like me to try, or if you have any other suggestions.
this design may have worked on earlier versions
public function layout(): array
{
return [
Layout::modal('exampleModal', [
Layout::rows([]),
]),
Layout::rows([
Input::make('zero')
->type('text')
->title('Zero:')
]),
$this->layoutAnother(),
];
}
public function layoutAnother(): array
{
$logic = true;
$row = Layout::rows([
Input::make('one')
->type('text')
->title('One:')
]);
if($logic){
$row = Layout::rows([
Input::make('another')
->type('text')
->title('Another:')
]);
}
return [
$row,
Layout::rows([
Input::make('two')
->type('text')
->title('Two:')
]),
];
}
Describe the bug After updating a project from version 13 to 14, all editing screens simply stopped working, with the error "Illegal offset type in isset or empty", from what I understand, it seems that the model defined in the query is not passing for layout components.
I created a components Reusing Layouts, and when using it on a page, it seems that it doesn't receive the query values from the main PageScreen.
To Reproduce Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen.
Screenshots
Desktop (please complete the following information):
Server (please complete the following information):