atk4 / ui

Robust and easy to use PHP Framework for Web Apps
https://atk4-ui.readthedocs.io
MIT License
440 stars 104 forks source link

Lookup "Add New" button is broken with hasOne #2079

Closed bedengler closed 1 year ago

bedengler commented 1 year ago

Addnewtest.zip

I attached a small app example.

A form "OfferStep1Form" is loaded into the app and a model "OfferOrderInvoiceModel" is attached to the form. Within the model "OfferOrderInvoiceModel" there's a hasOne relation to "BecontactContactOverviewModel".

The lookup loads fine and shows all entries. But as soon as we click on "Add New" the modal trys to open up and an error pops up (see screenshot).

I'm pretty stuck as at a certain point it seems an entity is delivered although just a model should be delivered.

Is that a bug? Bildschirmfoto 2023-07-05 um 01 17 54

mvorisek commented 1 year ago

Please confirm you are using the latest atk4/{core, data, ui} develop versions.

Also can this issue be reproduced on some existing atk4/demo using a model from demos/init-db.php?

bedengler commented 1 year ago

Confirmed, the issue is reproducable in demos. Running atk 3.1 - can you please test in other versions? lookup-bernie.php.zip

mvorisek commented 1 year ago

Thank you for the repro on demos. I tested it now and at least on develop the problem is fixed/not present. I was able to click on "Add New" and save the record.

Closing as we no longer support v3.1. I advise to upgrade asap. If you cannot upgrade now, I advise to follow the backtrace to better understand the issue /w v3.1.