Database queries for insert, update and delete should use the new database abstraction layer rather than db_query. This is currently causing issues with multisite as values are not inserted into the database correctly in contemplate_refresh_files. It should be:

/**
 * Refresh the listing of template files for the current site
 *
 * This refreshes the file listing whenever a ConTemplate admin screen is called
 */
function contemplate_refresh_files() {
  $data = drupal_system_listing('/\.tpl\.php$/', 'contemplates', 'name', 0);
  $conf = conf_path();
  db_delete('contemplate_files')->condition('site', $conf)->execute();
  if (!empty($data)) {
    $fields = array('site' => $conf, 'data' => serialize($data));
    db_insert('contemplate_files')->fields($fields)->execute();
  }
}

Don't have time to roll a patch right now, but I'll look through for any other instances of this later and make one.

CommentFileSizeAuthor
#1 contemplate.patch2.45 KBjustafish

Comments

justafish’s picture

Title: Deprecated db_query usage » Port to D7
Category: bug » task
Status: Active » Needs work
StatusFileSize
new2.45 KB

This patch removes deprecated database usage, enables disk based templates to work and changes a few pass-by-reference functions to pass-by-value.

Rolled against latest Contemplate D7 branch head.

jrglasgow’s picture

Justafish,
I have committed this patch. Are you interested in becoming a co-maintainer of this module. I could use the help.

justafish’s picture

Sure :)

Next patch I'm working on is addressing the $node->body['und']... related errors and it's currently inability to use viewable rendered fields in a template (or so I've found so far, need to check that)

rickmanelius’s picture

Is it worth keeping this issue open? Or is there a list of things todo for a 7.x-1.1 release?

rickmanelius’s picture

BTW, sweet, this works. Thanks!

rickmanelius’s picture

Status: Needs work » Closed (fixed)

Seeing as there is both a stable and dev version available, this can probably be closed...