On http://www.mysite.org/?q=weblinks Page I have this error :
"Fatal error: Call to undefined function db_rewrite_sql() in weblinks.module on line 1173"
I see that db_rewrite_sql() is not implemented in Drupal 7

Comments

summit’s picture

GStegemann’s picture

StatusFileSize
new9.06 KB

I tried to convert the db_rewrite_sql calls (see attached patch), but there still some changes and a review needed.

Additionally I changed all hook_perm functions to hook_permissions and all db_result(db_query()) constructs to db_query()->FetchField;

GStegemann’s picture

StatusFileSize
new13.08 KB

In the meanwhile I've implemented more changes, especially to get hook_load to work.

But currently I'm facing a problem creating the form for the body field.

***************
*** 122,131 ****
      );
    }
    if ($type->has_body) {
!     $form['body_field'] = node_body_field($node, $type->body_label, $type->min_word_count);
      $form['body_field']['body']['#rows'] = 5;
      $form['body_field']['body']['#default_value'] = isset($node->body) ? $node->body : variable_get('weblinks_body_stub', '');
!     $form['body_field']['format'] = filter_form(isset($node->format) ? $node->format : variable_get('weblinks_format', FILTER_FORMAT_DEFAULT));
    }
  
    $form['url'] = array(
--- 122,131 ----
      );
    }
    if ($type->has_body) {
!     $form['body_field'] = field_view_field('node', $node, 'body');  // $type->min_word_count
      $form['body_field']['body']['#rows'] = 5;
      $form['body_field']['body']['#default_value'] = isset($node->body) ? $node->body : variable_get('weblinks_body_stub', '');
!     $form['body_field']['format'] = NULL; // isset($node->body['und'][0]['format']) ? $node->body['und'][0]['format'] : variable_get('weblinks_format', filter_fallback_format());
    }
  
    $form['url'] = array(

When setting up $form['body_field']['format'] with $node->format the PHP error 'PHP Fatal error: Unsupported operand types in /var/www/html/cm7/includes/form.inc on line 1759, referer: http://www.igs.ld/cm7/de/admin/content' is raised. Setting 'format' to NULL works fine. The value in $node->format seems to be correct. Any ideas what is wrong here?

GStegemann’s picture

StatusFileSize
new13.08 KB

Sorry, bad file name.

GStegemann’s picture

Status: Active » Closed (fixed)