Removing block does not delete the table

Permalink Browser Info Environment
I recently used designer content to create a test block. (Thank you for providing this tool. It is extremely useful for learning about block construction.)

Based on my testing I discovered that the tool does not have an option for creating integer fields and creates all character fields as type "X". In order to correct these problems I copied the block files to another directory with a new name and made the necessary changes to the new block files to reflect the name change and database changes.

Now I want to install my new block with the changes and delete my test block. So I went to the dashboard, selected the test block and selected remove. The block was removed from the block types in the dashboard but the database table still exists in the concrete mysql database.

I can go into xampp and drop the table but before I do that I want to make sure there are not another mysql tables / dependencies that I will break by doing this manually. I also want to understand why the table did not delete.

I will mention that my localhost where I am currently testing concrete5 is running windows using a default mysql installation under xampp. It is my understanding that the default mysql installation for windows sets lower_base_table_names to "1" so that all tables names and associated filenames on the server are converged to lowercase. With this setting MySQL converts all table names to lowercase for storage and lookup. So even though the controller.php file calls the table btDCTestHike the table is created, stored and accessed in mysql as btdctesthike (the file in the mysql data director is also called btdctesthike.frm). Maybe I am wrong about how this setting works. Could this be why the table was not dropped automatically? Should I change this setting?

I am also wondering why you are using the getSearchableContent function in controller.php. It is my understanding that content will be searchable as long as it is in appropriate areas (such as Main) selected in the search index under the system setting in the DashBoard.

Thanks in advance for taking the time to answer my questions.

Type: Discussion
Status: New
dgreer
View Replies: View Best Answer
jordanlev replied on at Permalink Best Answer Reply
jordanlev
Hi,
These are great questions!

* re: block table deletion: This is a limitation of the C5 system itself. I don't know for sure why they decided not to delete block tables when blocktypes are uninstalled -- but my guess is that it's to prevent accidental data loss, in the event that a user uninstalls a block by accident but then re-installs it immediately... all the data is still in the block record. (Of course, the data is not going to be visible to a normal user because the blocks will have been disassociated from the pages they were on upon uninstallation... so it would require someone who knows what they're doing with MySQL to retrieve this "lost" data... but I guess that's better than it being gone forever with no chance of recovery).

* re: Windows case-sensitivity... yes this is a problem. See:
https://github.com/ahukkanen/c5_db_case_sensitivity...
http://www.concrete5.org/community/forums/installation/table-names-...
http://www.concrete5.org/community/forums/installation/uncaught_exc...
http://www.concrete5.org/community/forums/installation/move_from_xa...

* re: getSearchableContent: Content will be searchable as long as it is in the appropriate area, but ONLY for block types that have the "getSearchableContent()" function. A brief glance at the core code shows that the only built-in blocks with this in place are "Content", "HTML", "File", and "RSS Displayer". You could test this out by putting an image block on a page and seeing if that comes up in search results, for example. There are many good reasons for it to work this way. For one, you don't want some block types to be in the search results (for example, the AutoNav menus). Another is that you need a way to specify some searchable text on non-textual content (like images or videos) -- the computer can't just read an image file and know what the subject matter is. Well, maybe google can do that now, but not a dinky little Concrete5 site on a shared host :)

Hope that helps!

-Jordan
dgreer replied on at Permalink Reply
dgreer
Jordan,

Thanks so much for your help. The fixes corrected the problem.

Hopefully a note about this option setting in the mysql my.ini config file will make it into the installation notes. My guess is that I am not the only person running concrete on a windows localhost.

Thanks again.

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.