Closed (fixed)
Project:
Content Construction Kit (CCK)
Version:
5.x-1.0-beta
Component:
content.module
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Dec 2006 at 03:07 UTC
Updated:
18 Dec 2006 at 14:45 UTC
Jump to comment: Most recent file
Comments
Comment #1
drewish commentedRunning this I'm getting the following warning:
user warning: Field 'min_word_count' doesn't have a default value query: INSERT INTO node_typeWe should probably add a field to fix that too.
Comment #2
drewish commentedhere's one that fixes that.
Comment #3
yched commentedWe should probably add a text message in $ret[] saying something like "the content type %content_type has been moved to node_type table" (or just one message for all content types). With this patch it seems like the update just drops node_type_content, which might be quite scary...
BTW, isn't there some rule about 5.0 (or "4.7 to 5.0") updates having to be numbered from 1000 on, or is it just for core, or is just me mixing things up ? I have one or two commits I'm holding off until I can figure this out, to no avail so far...
Comment #4
RobRoy commentedI think the 1000 numbers are just for core. Module updates just go sequentially.
Comment #5
RobRoy commentedBut...I could be wrong. :)
Comment #6
drewish commentedyeah, returning a message is probably a good idea.
i didn't change the DROP. that was already there, but i agree it is scarry.
i don't think that there are any specifications for update numbering. regarding CCKs update numbering you should take a look at: http://drupal.org/node/100744
Comment #7
karens commentedThe downside of using db_query is that you don't get the db_query results displayed in the update results page, only update_sql queries show up there. So which is more beneficial, avoiding the escaping or displaying the query? I kind of like to see the query that has been run myself, but I don't feel that strongly either way, so I'll go along with whatever everyone agrees is best.
And obviously we need to update the min_word_count. I think that field was a late addition, at least I don't remember seeing when I was working with the update script originally.
Comment #8
RobRoy commentedHmmm...we should patch update_sql() to accept params in an optional array() so we can pass that array to db_query(). Here's an existing issue that will solve this for 6.x http://drupal.org/node/36324.
For this, I'd say run it through db_query and print out a custom message with info about the query.
Comment #9
karens commentedI'm going to add this change to http://drupal.org/node/100744 and commit the result, so I'm marking this fixed.
Comment #10
webchickHm. I'd advocate continuing to use update_sql, since that is the standard for update hooks, and instead passing the arguments through db_escape_string first before they're passed to the query, since that's what db_query would normally do.
The core patch to make update_sql behave as db_query would be a good idea too.
Comment #11
karens commentedYes, I'm going back to update_sql using db_escape_string, but I'm doing it in the other issue. I tried the idea of db_query plus a message, but that's actually messier than just using db_escape_string.
Comment #12
(not verified) commented