First item is shown twice when looping over a datalist

Silverstripe Version:
5.0
Question:
Site runs as expected under SS 4.13. After updating to 5.0 the first element of every datalist looped over in a template is shown twice. Code responsible is SSViewer_Scope::next(), line 317

$this->itemIterator->rewind();

Uncommenting this solves the problem and has not shown any adverse effects (yet). The database used is SQLite3. SQLite3Query::numRecords() and SQLite3Query::getIterator() seem to return correct values though. I’m at a loss. Have I missed something obvious? :thinking:

If this happens with SQLite and not with MySQL, then it is probably a bug in the (unsupported) silverstripe/sqlite3 module. If that’s the case, it would be prudent to raise a GitHub issue for this, and then get to work on seeing if you can fix it yourself. Because it’s not supported, and no community members have stepped forward to maintain it yet, the chances of someone else raising a PR to fix it are fairly slim.

If it happens with MySQL as well, then it is likely a bug in silverstripe/framework directly. If that’s the case, please raise a GitHub issue for this with as much detail and reproduction steps as you can provide.