I think I found it.
I wasn't actually able to reproduce the exact same error, but through another one in javascript I think I got the idea of where the error is.
In sources/subs/Editor.subs.php, when the arrary is filled, the "last" row is marked (TBH I'm not entirely sure it's necessary, but let's leave it there for the moment <= we may convert all that stuff to "proper" JSON at some point in the future), and it is find like this:
$context['smileys'][$section][count($smileyRows) - 1]['isLast'] = true;
But, the "last row" could under certain circumstances be different (e.g. in the db the "row" is not always strictly sequential).
So, changing the block:
foreach ($context['smileys'] as $section => $smileyRows)
{
foreach ($smileyRows as $rowIndex => $smileys)
$context['smileys'][$section][$rowIndex]['smileys'][count($smileys['smileys']) - 1]['isLast'] = true;
if (!empty($smileyRows))
$context['smileys'][$section][count($smileyRows) - 1]['isLast'] = true;
}
to:
foreach ($context['smileys'] as $section => $smileyRows)
{
$last_row = null;
foreach ($smileyRows as $rowIndex => $smileys)
{
$context['smileys'][$section][$rowIndex]['smileys'][count($smileys['smileys']) - 1]['isLast'] = true;
$last_row = $rowIndex;
}
if ($last_row !== null)
$context['smileys'][$section][$last_row]['isLast'] = true;
}
seems to fix the problem.