Drupal entity method loading twice

Lately I've been building a Drupal 7 module with the Entity API but I've run in to a problem. When debugging an edit form I've noticed that the load method is called twice which is causing an error.

Recoverable fatal error: Object of class stdClass could not be converted to string in DatabaseStatementBase->execute() (regel 2039 van /drupal7/includes/database/database.inc).

This is caused by FooController::load being executed twice.

Underneath is the code I've been using.
<?php
function foo_menu() {
$items = array();
...
$items['admin/foo/%foo/edit'] = array(
'title' => 'Edit foo',
'page callback' => 'foo_edit',
'page arguments' => array(2),
'access arguments' => array('administer content'),
'type' => MENU_CALLBACK,
);
...
return $items;
}

function foo_edit($foo) {
return drupal_get_form('foo_edit_form', $foo);
}

function foo_edit_form($form, &$form_state, $foo) {
$form['#foo'] = $foo;
$form_state['values'] = $foo;

$form['id'] = array(
'#type' => 'hidden',
'#value' => $foo->id,
);
...
$form['picture'] = array(
'#type' => 'file',
'#title' => t('Picture'),
'#default_value' => $foo->picture->filename,
);
...
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
);

return $form;
}

Almost done installing, weird error

So I'm installing Drupal 7.0 on our server (web hosting hub) and I get to the end and i am greeted with these errors:

Warning: rmdir(/tmp/update-extraction/adaptivetheme/adaptivetheme_subtheme/css/ie) [function.rmdir]: Permission denied in drupal_rmdir() (line 2277 of /home/innods5/test/includes/file.inc).
Warning: rmdir(/tmp/update-extraction/adaptivetheme/adaptivetheme_subtheme/css/schemes) [function.rmdir]: Permission denied in drupal_rmdir() (line 2277 of /home/innods5/test/includes/file.inc).
Warning: rmdir(/tmp/update-extraction/adaptivetheme/adaptivetheme_subtheme/css) [function.rmdir]: Permission denied in drupal_rmdir() (line 2277 of /home/innods5/test/includes/file.inc).
Warning: rmdir(/tmp/update-extraction/adaptivetheme/adaptivetheme_subtheme) [function.rmdir]: Permission denied in drupal_rmdir() (line 2277 of /home/innods5/test/includes/file.inc).
Warning: rmdir(/tmp/update-extraction/adaptivetheme/adaptivetheme/js) [function.rmdir]: Permission denied in drupal_rmdir() (line 2277 of /home/innods5/test/includes/file.inc).
Warning: rmdir(/tmp/update-extraction/adaptivetheme/adaptivetheme/css/images) [function.rmdir]: Permission denied in drupal_rmdir() (line 2277 of /home/innods5/test/includes/file.inc).

Migrate web site to drupal

Dear all, I will help a non-profit making organization to migrate the web site: http://www.rotarynt.org/
I would like to use the drupal7 to do this. However, could anybody tell me the steps that I need to do to migrate this to drupal?

I am new to drupal.

Thanks a lot.
Peter

Clean url test won't even run? Where to start?

I finally got 7 installed and working without any errors, I was previously having database errors so I tried installing 6 and upgrading.

However, now I go to config and click the button to run the clean url self test, and nothing happens. Doesn't reload or redirect me anywhere.
Is this one of the common problems like the http confg or mod_rewrite? I didn't look into what I've found because I don't know where to start..

Add new column/field to administration user listing

For the life of me I can't find a solution or post on how to do what should be a simple, common task:

How does one add a column to the administration listing of users?

For example, if one added a 'first_name' field on the user registration form, how can one view it in the admin user listings (and perhaps even sort using it)? Does every one just make a Views page and bypass the admin menu option altogether?

Moving from folder to root?

Hi All,

I assumed this part would be nice and easy. I built my Drupal website instead a folder on the root of the live site.

I am now ready to go live, and I am keeping the same database, so I assumed I would just need to copy the files over from the folder to the root.

But I am getting an error of 'Page not found' when I visit index.php of the root. Which step am I missing?

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x