Running ExpressionEngine 2.6.1 and Matrix 2.5.5
If I import/update multiple entries at once using the channel entries API, all the matrix rows inside exp_matrix_data have the same entry_id applied as the first entry that was inserted/updated.
After digging through, it's stemming from the _save method inside ft.matrix.php, the conditional in line 2376
if (empty($this->entry_id))
{
$this->entry_id = $this->settings['entry_id'];
}
On subsequent requests, $this->entry_id is not empty, so $this->entry_id contains the previous entry_id.
I've resolved for now by updating the above code to:
if (!empty($this->settings['entry_id']))
{
$this->entry_id = $this->settings['entry_id'];
}
That seems to have fixed the issue.