The create_nodes() function hard-codes the content types it creates as:
$possible_types = array("story", "blog", "forum", "page");
We'll either need to allow for extending these types or come up with a custom function to generate project* data.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | project-content_4.patch | 8.46 KB | webchick |
| #12 | project-content_3.patch | 8.19 KB | webchick |
| #10 | project-content_2.patch | 8.6 KB | webchick |
| #8 | project-content_1.patch | 7.93 KB | webchick |
| #7 | project-content_0.patch | 7.66 KB | webchick |
Comments
Comment #1
webchickAs an experiment, I changed that line to:
Although releases and issues are created, no projects are (presumably because of missing data) and therefore, the test data is useless.
So looks like we'll need custom content creation functions for these types.
Comment #2
webchickTeehee. It's project_project, not project. ;)
This patch extends the create_nodes() function so you can pass in an array of additional allowed types, and then passes project_* types in.
I would've assumed that I should patch generate-content.php upstream in devel module, but it no longer seems to be around. :(
Comment #3
webchickMeh. While this works, it's not ideal, because all the relevant metadata info (project category, status/priority for issues, etc.) aren't there. Back to the drawing board...
Comment #4
dwwit's evil that this profile is forking generate-content.php. in fact, it just nailed me on a test site, where the
include_once "generate-content.php";was finding an old copy from devel, instead of the one in here, and that was ignoring what we were asking it to do and going off to generate 10K nodes on its own. :(i'd rather we just required devel module (which we do already), and then just used devel_generate.module's functions directly (e.g. devel_create_nodes()), instead of maintaining our own fork of this code.
Comment #5
webchickdww, I moved your last comment to its own issue... http://drupal.org/node/143803 because, while important, it doesn't have specifically to do with bootstrapping project* data.
Here is a script that auto-generates a sample project in each category (other than modules -- need to figure that out some other time when it's not 1am ;)).. I broke function _drupalorg_testing_get_tid_by_term($term) { into its own function because this is the second time I've had to do that now (also in project admin settings).
Comment #6
webchickGood news! Here's a patch that auto-generates several projects when pasted into a PHP node body. WOOHOO.
Bad news! It doesn't work on install. :( The projects create, but they are not assigned any taxonomy. :( :( I have no idea how to get around this problem. On the Sony Multisite work, we did a hack in a hook_menu() of a specic install.module, but we can't upload modules to the /profile directory so I have no idea what to do. :(
Comment #7
webchickdww suggested it might be because we're trying to use drupal_execute rather than node_save, so I switched the code around a bit... same result. :( Works fine when pasted into a PHP node, but category assignment fails when run at install time...
Comment #8
webchickOk. Enter the cheesy hack patch. ;)
This one does raw db manipulation to get the term associations in there. It's ugly. But it works.
I'm also changing the title to deal only with projects. This was a big enough pain in the rear, that I don't want to even try and do releases and issues on the same ticket. ;)
Comment #9
dwwpatch doesn't apply. looks like your copy of drupalorg_testing.profile is stale, and doesn't include my changes in revision 1.9.
also, i wonder about assigning *all* the projects to be owned by the admin. part of the fun on d.o is that different kinds of users have different permissions and own different projects. i'd like to see a spread of project ownerships. among some of the well-known users at different roles. see also http://drupal.org/node/144427.
finally, i wonder how things work regarding the CVS integration for these newly added projects. i know none of the CVS stuff is really even started yet (e.g. an actual same CVS repository configured to talk to the test site, with some dummy code for the projects we're defining). but, for example, on the project edit pages, we should at least fill in the CVS directory setting and repository, no? if drupal_execute() does what i think it does, i wonder why this is passing validation at all. probably because hook_form_alter() isn't available yet due to evil bootstrapping bugs (if that's all true), so cvs.module's extensions and custom validation of the project form isn't actually happening. :(
the CVS stuff isn't a reason to hold up this patch (see http://drupal.org/node/144429 instead), but the fact it doesn't apply and the project ownership stuff are why i'm setting to CNW.
thanks for all your work on this, webchick! this profile is going to *seriously* improve life for the entire drupal project.
Comment #10
webchickThere was some deal with the CVS fields... I didn't have a repository to select, so it wouldn't submit the name, I think. But if possible, I'd really rather handle that in a separate "initialize CVS starer data" patch. We can amend the create scripts here in the future.
Right you are about the stale copy and the random users. So this patch adds that.
Comment #11
dwwwebchick, you're gonna kill me, but _drupalorg_testing_get_random_user() isn't what i had in mind. ;) from comment #9:
...among some of the well-known users at different roles. see also http://drupal.org/node/144427.
for the issues, followups, forum posts, etc, etc, random users is great. however, for the projects themselves, it'd be nice to be able to have all of them owned by the users in the 'user switcher' role, so that you can easily test all of those things among a known set of users.
Comment #12
webchickOk, here's a re-roll that ditches the random stuff and goes with names that will be generated in the other patch (dww's working on this atm). Still CNW because I can't test it until those are done, but we agreed on these naming conventions so hopefully it should "just work" once the users patch gets in.
I went with *1 as the names rather than mixing it up too much, because I thought that way we could test a few with more than one project. I don't really have a preference though. ;)
Comment #13
webchickOk, this should be ready to go.
Comment #14
dwwworks like a charm, and the code looks good, too. thanks!
Comment #15
webchickCommitted! :) Thanks, dww.
Comment #16
(not verified) commented