Major mySQL error when trying to generate block

Permalink Browser Info Environment
Hey!

Has anyone else experienced this error when attempting to create a block?

mysql error: [1048: Column 'btDisplayOrder' cannot be null] in EXECUTE("INSERT INTO BlockTypes(btID,btHandle,btName,btDescription,btActiveWhenAdded,btCopyWhenPropagate,btIncludeAll,btIsInternal,btInterfaceWidth,btInterfaceHeight,pkgID,btDisplayOrder) VALUES (NULL,'test','Test','',1,0,0,0,'700','450',0,NULL)")

Type: Discussion
Status: New
rainmaker
View Replies: View Best Answer
jordanlev replied on at Permalink Reply
jordanlev
Nobody has reported this yet (and I haven't run into it myself). What version of C5 are you using, and what version of Concrete5?
And what modifications have you made to your core system (or to the Designer Content package), if any?
rainmaker replied on at Permalink Reply
rainmaker
Hey JordanLev!

I'm using 5.5.2.1. I haven't gone in and edited any of the core files or the Designer Content package any. I attempted to use the plugin right after I installed it.

Hmmm. One thing I did awhile ago was upgrade to the latest C5 and then had to go backwards due to a plugin compatibility issue. Think that might be it?
jordanlev replied on at Permalink Best Answer Reply
jordanlev
That could definitely cause this... the "Display Order" feature wasn't added until 5.6, and I don't think there is anything that reverts database schemas in the case of downgrades.

You could try this... but before you do you will want to back up your database (otherwise your entire site could be hosed with no way to recover it). Did you back up your database yet? I'm serious... don't attempt this without first backing up your database!

Okay, now that you've backed up your database, go into the database with PhpMyAdmin, and delete the "btDisplayOrder" column from the "BlockTypes" table. That should fix this issue. Test out the site a little though... this Designer Content thing and also just general viewing the pages, and adding blocks to pages (and editing some blocks already on pages)... make sure you don't encounter any weird errors. If you do, revert to the database backup. But I don't think that will cause issues since that field didn't exist in 5.5.2.1.

Good luck!
rainmaker replied on at Permalink Reply
rainmaker
Ah gotcha. Thanks JordanLev!! :) Worked like a charm.
jwebolution replied on at Permalink Reply
jwebolution
Thanks Jordan.

I had the same problem where I had tried to upgrade to 5.6, then reverted it, and this wouldn't let me install packages moving forward. I went back now and re-installed 5.6.2.1 and now I'm able to install packages.

-Hamlet
pixeleleven replied on at Permalink Reply
pixeleleven
Hi Guys,

Thought I would jump on this thread rather than create another. I have just had the same error come up, but I am unsure from the posts here exactly how rainmaker fixed this.

I have just moved over a site to another server with the database, Designer Content block was working before hand. I then got the mysql error after trying to make another block using the add on.

So I deleted the add on, as someone told me that if I re-install the block it will add the missing table into my DB, it did not, I have the new add on installed, tried to make a block and got this error.

mysql error: [1048: Column 'btDisplayOrder' cannot be null] in EXECUTE("INSERT INTO BlockTypes(btID,btHandle,btName,btDescription,btActiveWhenAdded,btCopyWhenPropagate,btIncludeAll,btIsInternal,btInterfaceWidth,btInterfaceHeight,pkgID,btDisplayOrder) VALUES (NULL,'job_listing','List A Job','Use this for listing a job',1,0,0,0,'700','450',0,NULL)")


Any help on this would be really great

Thanks
jordanlev replied on at Permalink Reply
jordanlev
The problem he had was that he upgraded to 5.6, then downgraded to 5.5. Did you do that as well? If so, follow my instructions in my response above (the one marked as "best answer" in green).

-Jordan
pixeleleven replied on at Permalink Reply 1 Attachment
pixeleleven
Hi Jordan,

Thanks for the speedy reply

No, I am on 5.5.2.1 and have that error.
I attach a screen grab of that table, is it because the btDisplayOrder table has 0 in it?

This whole Add On was working fine before.

Thanks

Nick
jordanlev replied on at Permalink Reply
jordanlev
That's really strange that you're on 5.5 but have that btDisplayOrder column in the database. Are you **sure** this database wasn't from a 5.6 site or restored from a 5.6 backup?

Regardless, you seem to be hesitant to follow the instructions above to fix it. Is there a reason you don't want to do that? If so, let me know what that is so I understand. If not, just go ahead and try it already :)

-Jordan
pixeleleven replied on at Permalink Reply
pixeleleven
Hi Jordan,

Thanks for the reply. Yes, I have always been on 5.5.

I am certainly hesitate if I trash my site which is just in the process of going live on the clients server ;o)

Are you saying that I delete that whole btDisplayOrder column, see my screencap from previous.

What happens to all the other data in that column, which has 1-23 in in, will it not affect other modules in the site by deleting?

Thanks

Nick
jordanlev replied on at Permalink Reply
jordanlev
Yes, there is always a risk when mucking about in the database. That's why I insist that you back up the database before attempting this. But if you back up the database, then remove the column, then do some testing on the site to make sure everything is working and nothing has broken, then it's okay. You'll want to test viewing the site as a logged-out user, editing the site content as a logged-in admin (adding, editing, removing blocks), and also play around on the "Block Types" dashboard page, which is where a lot of this block types stuff happens and where you might see an error if one were going to occur.

Best of luck!

-Jordan
pixeleleven replied on at Permalink Reply
pixeleleven
Hi Jordan,

Sorry to bring this up again. I did some testing on another site using the Designer Content Add On and it works fine, so I am sure that for this sites problems I am having, there must be a database problem as you suggested.

I have now backed up the DB and in phpMyadmin and can see the btDisplayOrder column, again, looking like my screencapture I attached to the post in Nov.

Problem is, how do I delete that column?

When I click on it it it says drag to reorder, click to sort, but no DELETE?

Thanks

Nick
jordanlev replied on at Permalink Reply
jordanlev
The screenshot from November is showing the "Data" of the table, but you want to go to its "Definition" or "Structure" (not sure what the exact term is in phpMyAdmin). Then you'll see each field of the table as a row in the grid, and should be able to delete it from there.

Good luck!

-Jordan

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.