In J3.10, editing an existing entity resulted in $this->item in the edit template being fully populated. I never really figured out this magic in over a decade of working with Joomla, but broadly it seems that the following takes place:
the view calls $this->get('Form')
getForm() in the model is called with loadData = true,
loadForm() in the model is called
getItem() in the model loads the data for the entity into $this->item
The populated form is displayed in the template, data shown with renderField()
When a new entity is added $this->item is null, so the default values in entity.xml are displayed.
Here's the problem: in J4.0 I get a whole bunch of "Warning: Undefined property: stdClass::xxx ..." errors because $this->item is null.
What's changed? It seems that getItem() is not called in J3.10 when adding a new item but it is in J4.4.
Do I need to hack up some sort of dummy entity to be displayed? Or is it just a bug?
Any help would be great
