This is my first time working with the DBTNG and I like it. This is the patch to get contact to DBTNG. I ran the tests and they were working fine.

While working on this patch we talked about what should be the prefered method to fetch a single record (so not just one column) from the database. Angie and Larry decided to go for:

  $contact = db_query("SELECT * FROM {contact} WHERE cid = :cid", array(':cid' => $cid))->fetchAssoc();
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

R.Muilwijk’s picture

Assigned: Unassigned » R.Muilwijk
Status: Needs review » Needs work

Hmmz... sorry not yet 100%

Forgot to port the .test file :P

Crell’s picture

Assigned: R.Muilwijk » Crell
Issue tags: +DBTNG Conversion, +dc2009 code sprint

Someone needs to pick this this up.

Dave Reid’s picture

Component: database system » contact.module
Crell’s picture

Assigned: Crell » Unassigned
cyberswat’s picture

Assigned: Unassigned » cyberswat
cyberswat’s picture

Status: Needs work » Needs review
FileSize
8.47 KB

Status: Needs review » Needs work

The last submitted patch failed testing.

cyberswat’s picture

Status: Needs work » Needs review
FileSize
8.96 KB
Crell’s picture

Status: Needs review » Needs work

There's no need to make select queries dynamic unless we actually need dynamic behavior. Converting queries we don't need to just slows them down. Example:

-  $result = db_query('SELECT cid, category, recipients, selected FROM {contact} ORDER BY weight, category');
+  $result = db_select('contact')
+    ->fields('contact', array('cid', 'category', 'recipients', 'selected'))
+    ->orderBy('weight')
+    ->orderBy('category')
+    ->execute();

The static form would be better.

+    db_update('contact')->fields(array('selected' => 0))->execute();

That should be broken up to 3 lines:

db_update('contact')
  ->fields(array('selected' => 0))
  ->execute();
$this->assertTrue(db_query('DELETE FROM {flood}'), t('Flood table emptied.'));

That should be converted to db_delete().

cyberswat’s picture

Status: Needs work » Needs review
FileSize
8.53 KB
Crell’s picture

Status: Needs review » Reviewed & tested by the community

Sweet. Thanks!

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed! Yay!! :D

Status: Fixed » Closed (fixed)

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

pp’s picture

Status: Closed (fixed) » Needs review
FileSize
665 bytes

Contact admin page is not working! (admin/build/contact)
We collect the data in the $row array but we give the temlplate the name: $rows.
Here is a patch, please apply.

Sorry, I don't know what shall I do. I create a new issue (#413060: Contact list is empty.) and modify existing

mr.baileys’s picture

Status: Needs review » Closed (fixed)

Hi pp,

Thanks for writing the patch. However, it's generally not a good idea to reopen issues once they've been marked fixed or closed, especially since looking at your patch I think this is a different issue altogether.

Opening a new issue (as you did) is the way to go, so marking this one closed again.

pp’s picture

Ok, next time I will create a new patch. Thanks!

pp