This should be nice and easy. There's only 3 queries, all in the install file.

Comments

csevb10’s picture

StatusFileSize
new1.81 KB

Replaced the queries as appropriate in php.install. This is a pretty small patch, but I think it covers all the necessary pieces.

csevb10’s picture

Status: Active » Needs review

I have got to learn to change the status when I post the patch...

Crell’s picture

Status: Needs review » Needs work

When only inserting a single record into a table, it's better to just use ->fields() with an associative array. That way you never have to repeat yourself at all. Generally you only need to separate fields() and values() when doing a multi-insert.

csevb10’s picture

Status: Needs work » Needs review
StatusFileSize
new1.69 KB

Fair enough. New patch with those issues resolved.

csevb10’s picture

StatusFileSize
new1.7 KB

Small formatting change.

csevb10’s picture

StatusFileSize
new1.7 KB

Another small formatting change. Makes me wish I could delete and/or revise posts. Though, hopefully each pass is closer to 100% correct.

chx’s picture

Thanks for the work. What happened to - $format = db_result(db_query("SELECT MAX(format) FROM {filter_format}"));
though? Is format autoincrement?

csevb10’s picture

It's replaced by the call to db_insert since db_insert returns the same value that that query was looking for. I don't really think that MAX(format) was a particularly good way to get the last insert id, but this replaces that with core code in the database layer (example from mysql/query.inc):

    $last_insert_id = $this->connection->query((string)$this, $values, $this->queryOptions);

    // Re-initialize the values array so that we can re-use this query.
    $this->insertValues = array();

    return $last_insert_id;
chx’s picture

Status: Needs review » Reviewed & tested by the community

yes but that only works for serial fields but I looked it up and format is indeed a serial in filter_format table.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)
Issue tags: -DBTNG Conversion, -Novice

Automatically closed -- issue fixed for 2 weeks with no activity.