Unable to sort large number of blocks in Matrix field in CP and template I have about 145 blocks in a single Matrix. If I try and re-arrange (drag&amp;drop) the first few blocks, and then hit save, all is well. However, trying to re-arrange the last few blocks doesn't save at all, reverting the order as soon as I refresh.

I've pumped the php.ini settings (upload_max_filesize=128M, post_max_size=256M
,max_input_vars=4000) and set the block limit in CP to 200 so that shouldn't be the issue.

I'm also not getting a logged error.

Does this ring a bell with anybody?
This is because Craft stores the sortOrder values in the database with a MySQL column type of tinyint that happens to be signed, which means it can store a range of -128 to 127.

Aside from the fact that negative sort orders don't make much sense, that means if you have 127 or more Matrix blocks to sort, things will stop working as expected.  Because 127 things to sort ought to be enough for anyone, right?

Regardless, in the next (post 2.5.2765) release, we've changed all sort order column in the database to be unsigned smallints, which means they can store a range of 0 to 65535.