Concrete5.7 - How to re-install deleted system block?

Permalink
I had to delete a Conversation block from the admin panel because of a bug (after deleting a user, Conversation started showing a not found user error and the only way to make the site work was to delete the Conversation block). Now I've updated my site to the newest version of Concrete5 but the Conversation block has not appeared.

Is there any way to re-install a deleted system block? Thank you.

linuxoid
 
Justin1978 replied on at Permalink Reply
Justin1978
Did just delete a block or did you delete the block type from the database? If you deleted the block I don't think you can restore it because admin pages aren't versioned.

If you deleted the block type from the database you can restore it by adding it again in your database manager (like PhpMyAdmin). Make sure you use the right primary key.
linuxoid replied on at Permalink Reply
linuxoid
Justin,

I've deleted a block type. What exactly do I have to do in the database? Where and how can I add it in there? Thank you.
Justin1978 replied on at Permalink Reply
Justin1978
What version of Concrete are you using? I'm running 5.7.5.2.

Check the BlockTypes table in your database and check if the record with btID 5 is present. If not, execute the sql query below in your database manager. Also check if you have the same version and same database table structure before executing the query. As far as I can see, Concrete does not use foreign keys so everything should be working again if you restore the block type.

INSERT INTO `BlockTypes` (`btID`, `btHandle`, `btName`, `btDescription`, `btCopyWhenPropagate`, `btIncludeAll`, `btIsInternal`, `btSupportsInlineAdd`, `btSupportsInlineEdit`, `btIgnorePageThemeGridFrameworkContainer`, `btDisplayOrder`, `btInterfaceWidth`, `btInterfaceHeight`, `pkgID`) VALUES
(5, 'core_conversation', 'Conversation', 'Displays conversations on a page.', 1, 0, 0, 0, 0, 0, 22, 400, 400, 0);
linuxoid replied on at Permalink Reply
linuxoid
I'm running Concrete5.7.5.4.

I'll try to do that right now.
linuxoid replied on at Permalink Reply
linuxoid
It worked! Great. Thank you very much!!!

I notice I still have old conversations in the Conversations section but they are not displayed in the conversation block. Is there any way to retrieve them or add them to the database?
Justin1978 replied on at Permalink Reply
Justin1978
What exactly do you mean when you say you still have old conversations but you don't see them in the block? Because the purpose of the block seems to be to display those conversations. Or you do see the conversations but not the messages in the conversation?
linuxoid replied on at Permalink Reply
linuxoid
I see the messages in the Conversation section of the admin panel, but not in the Conversations block on a page
Justin1978 replied on at Permalink Reply
Justin1978
It is hard to say from here. This is basically how conversations work:

- Conversations are stored in the 'Conversations table' in your database.
- The corresponding messages are stored in the 'ConversationMessages' table.
- The conversation blocks are stored in the 'btCoreConversation' table (the column 'cnvID' is short for 'conversation id' and refers to the id of the conversation in the 'Conversations' table).

The conversations still seem to be there, judging from your response but it appears the block no longer refers to the conversation.

What you could do is look for the block in the 'btCoreConversation' table base on the the block's id which is stored in the 'bID' column. For this you will need to know the id (bID) of the conversation block. To get this id: in edit mode, click on the block (context menu appears), hover over the 'edit-link' and look for &bID=XXX in the url of the link (where XXX is a number). This is the id (bID) of your block. Now look in in the 'btCoreConversation' table in the column 'bID' for this id. There should be a record. Check this record for the 'cnvID' column and check if it contains the id of the corresponding conversation ('Conversations' table, also 'cnvID' column). If it's all there, something else is broken. But first check this. Also empty you cache first before doing anything. Cache is often a cause for stuff not working or showing up.