[drupal-devel] [task] Clean up block module tables
Project: Drupal Version: cvs Component: block.module Category: tasks Priority: normal Assigned to: drumm Reported by: drumm Updated by: TDobes Status: patch It should be noted that the patch here contains a fix for a CRITICAL bug in block.module: At the moment, custom blocks cannot be deleted. A patch containing the fix alone (without other improvements) is located in another issue, which was marked as a duplicate [1] quite a while ago. Since we're now in a feature freeze, perhaps I should reopen the other issue so the deletion fix alone can be committed? [1] http://drupal.org/node/14625 TDobes Previous comments: ------------------------------------------------------------------------ December 9, 2004 - 15:07 : drumm Attachment: http://drupal.org/files/issues/block.module_2.diff (9.54 KB) * renamed 'boxes' to 'blocks_custom' * changed the 'bid' column of that table to 'delta' and removed auto increment in favor of the usual db_next_id * made associated changes in code to avoid 'box' and 'bid' * removed unique constriant on custom box titles (http://drupal.org/node/11724) * put the delete link for custom blocks back in, it was apparently lost in another update ------------------------------------------------------------------------ December 9, 2004 - 15:26 : jhriggs I think the only thing I would question is the renaming of bid. It seems inconsistent with the rest of drupal. We use nid, rid, uid, etc., etc. So, this should be a block ID, bid. ------------------------------------------------------------------------ December 9, 2004 - 16:05 : drumm Delta is the best name since this is what hook_block() calls it. Adding a bid (b as in block) to the blocks table is a good idea, but I wouldn't want to confuse things with a patch that is renaming bid in one context and adding bid in a related but different context. ------------------------------------------------------------------------ December 9, 2004 - 16:22 : Dries I prefer bid. I'd rather change delta to bid, instead of changing bid to delta. It is more consistent. Otherwise the patch looks good. ------------------------------------------------------------------------ December 9, 2004 - 16:43 : drumm Delta really isn't a good id. It isn't unique. The closest thing to a primary key is the blocks table is (module, delta). I think bid should be added as a real primary key on the blocks table. If there is a good word to use in place of delta that isn't bid, then that would be good to use. ------------------------------------------------------------------------ December 10, 2004 - 18:22 : drumm Updated patch which adds: * Added index to weight column in blocks table * Added primary key bid to blocks table * Replaced module/delta construct with bid where possible In additon to the previous: * renamed 'boxes' to 'blocks_custom' * changed the 'bid' column of that table to 'delta' and removed auto increment in favor of the usual db_next_id * made associated changes in code to avoid 'box' and 'bid' * removed unique constriant on custom box titles (http://drupal.org/node/11724) * put the delete link for custom blocks back in, it was apparently lost in another update ------------------------------------------------------------------------ December 10, 2004 - 18:23 : drumm Attachment: http://drupal.org/files/issues/block.module_3.diff (20.41 KB) And the patch too ------------------------------------------------------------------------ December 12, 2004 - 02:58 : Dries The upgrade path gave me problems. I got a fatal error: <?php $ret[] = update_sql('ALTER TABLE {blocks_custom} DROP INDEX title'); ?> The index did not exist on my setup. Weird. I got several hundred warnings about this line: <?php foreach ($blocks as $delta => $block) { ?> It's somewhat tricky, because you can't execute that update twice. My user and block tables are pretty unusable now. :) (Is the block->info field still being used? It looks quite redundant to me.) ------------------------------------------------------------------------ December 12, 2004 - 03:52 : Dries I ran this update on a copy of the drupal.org database and it seems to work. The reason my previous attempt failed, is because of the way error reporting was configured. My copy of the drupal.org database doesn't have an index on 'blocks_custom.title' either, but it did not result in a fatal error nor did it cause the upgrade script to halt. Warning are suppressed so they are simply not shown. In short, depending on how error reporting is configured, the upgrade path might or might not work. If it doesn't work, you're screwed because you won't be able to run the upgrade script again. At least, not without intimate knowledge of Drupal's internals. -- View: http://drupal.org/node/14158 Edit: http://drupal.org/project/comments/add/14158
I got errors while trying to set up a localhost cvs version of Drupal running the mySQL script on v4.0.21-nt gives these errors: Warning: Do not know how to handle this statement at line 798: REPLACE variable SET name='update_start', value='s:10:"2004-10-18";'; Ignoring this statement. Please file a bug-report including the statement if this statement should be recognized. Warning: Do not know how to handle this statement at line 799: REPLACE variable SET name='theme_default', value='s:10:"bluemarine";'; Ignoring this statement. Please file a bug-report including the statement if this statement should be recognized. Warning: Do not know how to handle this statement at line 801: REPLACE blocks SET module = 'user', delta = '0', status = '1'; Ignoring this statement. Please file a bug-report including the statement if this statement should be recognized. Warning: Do not know how to handle this statement at line 802: REPLACE blocks SET module = 'user', delta = '1', status = '1'; Ignoring this statement. Please file a bug-report including the statement if this statement should be recognized. Carl McDade
Never mind, it is a bug in MySQL administrator. I can't handle Replace and Update. phpmyAdmin ran perfectly. Carl McDade wrote:
I got errors while trying to set up a localhost cvs version of Drupal running the mySQL script on v4.0.21-nt gives these errors:
Warning: Do not know how to handle this statement at line 798: REPLACE variable SET name='update_start', value='s:10:"2004-10-18";'; Ignoring this statement. Please file a bug-report including the statement if this statement should be recognized.
Warning: Do not know how to handle this statement at line 799: REPLACE variable SET name='theme_default', value='s:10:"bluemarine";'; Ignoring this statement. Please file a bug-report including the statement if this statement should be recognized.
Warning: Do not know how to handle this statement at line 801: REPLACE blocks SET module = 'user', delta = '0', status = '1'; Ignoring this statement. Please file a bug-report including the statement if this statement should be recognized.
Warning: Do not know how to handle this statement at line 802: REPLACE blocks SET module = 'user', delta = '1', status = '1'; Ignoring this statement. Please file a bug-report including the statement if this statement should be recognized.
Carl McDade
I downloaded the latest cvs and could not find a conf.php. When Ireid to use the conf.php from 4.5 branch there was no connection made. the variables were not being filled. What's going on with this? Carl McDade
Carl McDade wrote:
I downloaded the latest cvs and could not find a conf.php. When Ireid to use the conf.php from 4.5 branch there was no connection made. the variables were not being filled. What's going on with this?
RTFM! By that I mean the upgrade instructions in INSTALL :) Things have changed due to the multisite capabilities drupal now has, you'll find settings.php in sites/default. -- adrinux (aka Adrian Simmons) <http://adrinux.perlucida.com> e-mail <mailto:adrinux@gmail.com> AOL/Yahoo IM: perlucida, Microsoft: adrian@perlucida.com
I guess I am going to have to work with the docs team on this. I missed this because there is no "Upgrade" text and the present text is confusing. The settings.php should be under "installation->configuration". Who is charge of this? anyone mind if I go through and make it more user friendly? Carl McDade Adrian Simmons wrote:
Carl McDade wrote:
I downloaded the latest cvs and could not find a conf.php. When Ireid to use the conf.php from 4.5 branch there was no connection made. the variables were not being filled. What's going on with this?
RTFM! By that I mean the upgrade instructions in INSTALL :)
Things have changed due to the multisite capabilities drupal now has, you'll find settings.php in sites/default.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Carl McDade wrote: | I guess I am going to have to work with the docs team on this. I missed | this because there is no "Upgrade" text and the present text is | confusing. The settings.php should be under | "installation->configuration". Who is charge of this? anyone mind if I | go through and make it more user friendly? Actually, I had no problem finding it in the INSTALL.txt under the sections titled "UPGRADING". It could stand to be fleshed out a bit, but that is why it is not released yet. I think it is rather clear. But this is a Drupal-docs discussion, not a dev discussion. Brady -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCHJQYO+lwfsap+f0RArdCAKCJuNsTlT7FYqtRihG0AtGi2qK3PwCggkmP 4QAUuFCUOqMy4pnM5iPVfP8= =ShTP -----END PGP SIGNATURE-----
I did not find it because I find to find things and "upgrade" was not part of the text. But even after finding it there is no mention of the settings.php in that area. The question I gave has been answered though. So I will write a seperate tutorial on this rather than helping out and writing the install text. Thanks, Carl McDade "UPGRADING --------- 1. Backup your database and Drupal directory - especially your configuration file (www.example.com.conf or includes/conf.php). 2. Log on as the user with user ID 1. 3. Remove all the old Drupal files then unpack the new Drupal files into the directory that you run Drupal from. 4. Modify the new configuration file to make sure it has the correct information." Brady Jarvis wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Carl McDade wrote: | I guess I am going to have to work with the docs team on this. I missed | this because there is no "Upgrade" text and the present text is | confusing. The settings.php should be under | "installation->configuration". Who is charge of this? anyone mind if I | go through and make it more user friendly?
Actually, I had no problem finding it in the INSTALL.txt under the sections titled "UPGRADING".
It could stand to be fleshed out a bit, but that is why it is not released yet. I think it is rather clear.
But this is a Drupal-docs discussion, not a dev discussion.
Brady -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCHJQYO+lwfsap+f0RArdCAKCJuNsTlT7FYqtRihG0AtGi2qK3PwCggkmP 4QAUuFCUOqMy4pnM5iPVfP8= =ShTP -----END PGP SIGNATURE-----
Carl McDade wrote:
I did not find it because I find to find things and "upgrade" was not part of the text. But even after finding it there is no mention of the settings.php in that area. Apologies, I was a bit hasty and glib with my comment this morning, you do indeed have to read the full INSTALL.txt to understand where things have been moved.
-- adrinux (aka Adrian Simmons) <http://adrinux.perlucida.com> e-mail <mailto:adrinux@gmail.com> AOL/Yahoo IM: perlucida, Microsoft: adrian@perlucida.com
I guess I am going to have to work with the docs team on this. I missed this because there is no "Upgrade" text and the present text is confusing. The settings.php should be under "installation->configuration". Who is charge of this? anyone mind if I go through and make it more user friendly?
If you document something for end users, which is not yet for end users, it gets more confusing, not less. Goba
Should not the settings directory be called "settings" rather than Sites so that people can find it? Use of the words "configuartion and Settings is pretty much the status quo in all installations and thus promotes usability. The present installation instructions don't make the use of "Site" as the correct directory readily apparent. Even so there will be a heavy percentage of users that will not get it even after making an install or two. Settings default_site/ settings.php www.site1.com/ settings.php themes/ custom_theme modules/ custom_module www.site2.com/ settings.php themes/: custom_theme modules/ custom_module Carl McDade Adrian Simmons wrote:
Carl McDade wrote:
I downloaded the latest cvs and could not find a conf.php. When Ireid to use the conf.php from 4.5 branch there was no connection made. the variables were not being filled. What's going on with this?
RTFM! By that I mean the upgrade instructions in INSTALL :)
Things have changed due to the multisite capabilities drupal now has, you'll find settings.php in sites/default.
participants (6)
-
Adrian Simmons -
Brady Jarvis -
Carl McDade -
Gabor Hojtsy -
Negyesi Karoly -
TDobes