i wanted this while working on #1040790: _field_info_collate_fields() memory usage.

attached is a first cut, add devel_generate_content_types(), with a menu callback and drush command wrappers.

didn't get to batchifying it, but if people like the idea, i'll add that.

CommentFileSizeAuthor
#9 devel-generate-content-types-1397582-9.patch10.19 KBrodrigoaguilera
#7 devel-generate-content-types-1397582-7.patch8 KBAnonymous (not verified)
devel-generate-content-types.patch5.81 KBAnonymous (not verified)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

salvis’s picture

moshe will have to look into this, but just a quick question anyway: Given the linked issue, will this perform reasonably if batchified, or will we still run into trouble even with the core patch?

Should we postpone this until the core patch is committed?

Anonymous’s picture

re #1, i don't think we should wait. we can always adjust the batch size, but the point of this is not to make it fast, but to make it easy to work on patches like the one i linked to :-)

salvis’s picture

Yeah, I'm not so much worried about it being too slow, but about crashing, timing out, overloading the database, or exceeding the disk quota of limited accounts.

Any of this would cause us support issues that I'd rather avoid...

Anonymous’s picture

i think we can address the crash and timeout issues with the size of the batch.

as for the rest - wait, what? how is this different from a bunch of the other devel generate commands that can do all of those things?

salvis’s picture

I had a very cursory look at #1040790: _field_info_collate_fields() memory usage and got the impression that creating only a few content types would cause your database to explode, as long as the core patch hasn't been applied yet.

If that's the case, then we don't really want to provide a tool that will do just that.

Maybe I misunderstood the issue...

moshe weitzman’s picture

Status: Needs review » Needs work

Looks commit worthy to me. Lets add the batching. Also, do we really need the menu_rebuild() call in the loop? Thats pretty expensive.

Anonymous’s picture

Status: Needs work » Needs review
FileSize
8 KB

attached patch adds batching.

moshe weitzman’s picture

Looks good. If someone could test this, that would be good. If noone does, I will get to it.

If we do a later reroll, FormAPI should be two words.

rodrigoaguilera’s picture

I applied the patch and I I'm able to generate content types with the interface but I lose the overlay and no green succed message is shown.

via drush 6 beta 1 I get 2 errors

No hook functions were found for generate-content-types. The primary hook function is drush_devel_generate_generate_content_types(). Please implement this function. Run with --show-invoke to see all available hooks.

I renamed the function drush_devel_generate_content_types() to drush_devel_generate_generate_content_types()
and all other function names

and there is no menu_rebuild() anymore
http://drupal.org/node/1561492

I didn't fix the succeed message and the overlay issue.

Patch attached

Status: Needs review » Needs work

The last submitted patch, devel-generate-content-types-1397582-9.patch, failed testing.

pcambra’s picture

Status: Needs work » Needs review
pcambra’s picture

Issue summary: View changes
Status: Needs review » Needs work

Devel generation has changed to be pluggable in #2154141: DevelGenerate as a D8 plugin type so this needs a re roll.

Berdir’s picture

I didn't know about this issue, but I wrote a quick implementation using the new plugin system to test some core stuff, see https://gist.github.com/Berdir/75041aaa46f391e844ac, feel free to use whatever you want from that... Currently only supports text fields...

Maybe we could use #2217481: Create a PluginManager for field types in devel_generate to also create new fields to have flexible support for widget/formatter and field settings?

willzyx’s picture

Status: Needs work » Closed (outdated)

Closing for lack of activity. Feel free to reopen if the issue still exists