1

I have about 145 blocks in a single Matrix. If I try and re-arrange (drag&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?

  • Just to follow up, I'm able to add and change block content, ie the title, text or any fields within a block. Did some troubleshooting and it seems that any blocks after position 125 fails to update the sortOrder in the DB. Also, if I drag a block above the 125 mark, it sorts OK. – terjeofnorway Feb 24 '16 at 16:50
  • 1
    FYI: Craft 2.5.2767 is now up, fixing the issue as per Brad's answer below. – Mats Mikkel Rummelhoff Feb 24 '16 at 22:49
3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.