akeeba / fof

Rapid Application Development framework for Joomla!™ 3 and 4
0 stars 0 forks source link

Export also null fields in CSV #631

Closed Skullbock closed 7 years ago

Skullbock commented 7 years ago

It can happen that the first model in the csv list to export has some null fields. If this happens, those fields do not get exported even if some record afterwards has it because isset() checks for null value. Adding property_exists avoids that case

wilsonge commented 7 years ago

But property_exists isn't going to find the record data items right? Only top level model properties

nikosdion commented 7 years ago

Care to elaborate? Do you have a specific issue in mind?

wilsonge commented 7 years ago

Well if you are trying to access record data then it's in the $recordData property and can't be accessed. Same for relations that are stored in the $relationManager property.

So even with this change if you have either an item with a null value for record data or hasMany where the first item happens to have no relation (but others do) then you still loose columns.

I'm not exactly sure what this patch is solving?