Follow up for #1871772-108: Convert custom blocks to content entities
Problem/Motivation
+++ b/core/modules/block/block.install
@@ -194,6 +195,246 @@ function block_update_8006() {
+ db_create_table('custom_block', array(
...
+ db_create_table('custom_block_revision', array(
Normally we handle this case via hook_schema_0() implementations + update_module_enable(), but we can clean that up later.
Proposed resolution
Refactor upgrade path as indicated
Remaining tasks
Refactor upgrade path as indicated
Comment | File | Size | Author |
---|---|---|---|
#6 | custom-block-update-1919910.6.interdiff.txt | 6.62 KB | larowlan |
#6 | custom-block-update-1919910.6.patch | 6.95 KB | larowlan |
#4 | custom-block-update-1919910.4.patch | 7.2 KB | larowlan |
Comments
Comment #1
larowlanUntil #1871772: Convert custom blocks to content entities is in, this is postponed
Comment #2
sunComment #3
underq CreditAttribution: underq commentedHi,
I think it's all right to not implement this hook_schema in block module but to implement it in custom_block module, and it's already done.
Tell me if I am wrong :)
Comment #4
larowlanhi, yeah the tables are created in block.install in block_update_8007() but instead we should implement hook_schema_0() (which is a new hook for me!) in custom_block.install.
see http://api.drupal.org/api/drupal/core%21includes%21update.inc/function/u... for where this is invoked.
so the chain would be
block_update_8006() calls update_module_enable('custom_block')
which will in turn call custom_block_schema_0() (which needs to be added)
which will return the two tables and pass them back to update_module_enable() which will create the tables for us.
Then we can remove the two db_create_table() calls from block_update_8007()
Something like this
Comment #5
sunCan we use the usual schema array syntax here?
We can probably just simply copy/paste the entire function body of custom_block_schema() right now.
Comment #6
larowlanRefactored as per #5
Comment #7
sunThanks! Let's move forward here. This issue blocks #1920862: Rename custom_block.module to block_content.module
Comment #8
webchickI have no earthly idea what hook_schema_0() is and there are no docs. #1929816: Remove all references to/implementations of hook_schema_0()
Shooting this to catch, since he seems to have an understanding, so can likely tell whether this is proper use or not.
Comment #9
sun#1920862: Rename custom_block.module to block_content.module is waiting for this commit to happen.
Comment #10
catchYeah this is the correct usage as it stands. There's mountains of clean-up to do about enabling modules during the upgrade path, but we have two critical bugs open for those so at least this gets everything to the same level of brokenness.
No longer applies though.
Comment #11
tim.plunkettEr, it no longer applies because you committed it, it seems: http://drupalcode.org/project/drupal.git/commitdiff/b5f0af3
:)
Comment #12
Eric_A CreditAttribution: Eric_A commentedSeems like the changes to block_update_8007() weren't committed. The branch doesn't seem to be broken, though.
Can anybody confirm that we now have a bug here?