There were some changes in latest Drupal core that broke devel generate module. Here are the changes that I made:

  • updated the devel_generate.info file added core = 6.x see http://drupal.org/node/146910
  • $form_values is now $form_state['values'] http://drupal.org/node/144132#form-state
  • db_next_id http://drupal.org/node/149176 was removed. The only problem that I see is when we generate comments with #id in title this is no longer possible as there is no way of knowing which will be the next id for this comment. I solved this by using internal counter of devel_create_comments this means that if you create 2x500 titles of second comments will be the same as in first batch.
  • I was getting some notices which I fixed
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dww’s picture

Status: Needs review » Needs work

patch no longer applies cleanly:

wright% patch < devel.module.HEAD_.patch 
patching file devel_generate.info
Hunk #1 FAILED at 2.
1 out of 1 hunk FAILED -- saving rejects to file devel_generate.info.rej
patching file devel_generate.inc
patch: **** malformed patch at line 56: @@ -99,11 +102,11 @@ function devel_create_comments($records,

also, it's not just that db_next_id() is gone, we're not using {sequences} at all anymore. there are a few places in devel_generate.(module|inc) that continue to touch this table, which need to be cleaned up, too.

thanks,
-derek

Rok Žlender’s picture

FileSize
9.36 KB

Patch should now apply cleanly to HEAD.

I also removed other references to sequence table.

  • I removed lines where we update sequence table to 0
  • we used sequence table to get next nid for nodes I replaced this with SELECT MAX(nid) from node +1, this way we also get next nid. If node table is empty this also works if node table is empty. MAX returns 0 +1 is the next nid.
  • added a line when we clear previous content to empty term_node table

Everything else is left as in #1

Rok Žlender’s picture

Status: Needs work » Needs review
moshe weitzman’s picture

i will test and apply this this week.

i want though devel_generate to use node_save() and user_save() and so on, instead of doing custom DB inserts. patches welcome.

moshe weitzman’s picture

Status: Needs review » Fixed

committed. would be nice if someone looked into:
- two NOTICE errors when generating content
- the module does INSERTS and shows form elements even if comment.module is disabled.
- use ndeo_save() and user_save() and taxonomy save functions instead of direct DB inserts.

Anonymous’s picture

Status: Fixed » Closed (fixed)