Re: [development] development Digest, Vol 93, Issue 13
some weeks ago I offered a patch to module z3950. In this patch a new content type (based on CCK) is introduced and some nodes are initially filled using function of module "alternate_content_copy". I would be interested to get some responce if this approach looks acceptable to advanced Drupal developers. Please look at http://drupal.org/node/811690 file z3950/includes/z3950.install.inc Mit freundlichen GrĂ¼ssen Reiner Miericke Am Dienstag, 7. September 2010 14:00:02 schrieb development- request@drupal.org:
Send development mailing list submissions to development@drupal.org
To subscribe or unsubscribe via the World Wide Web, visit http://lists.drupal.org/mailman/listinfo/development or, via email, send a message with subject or body 'help' to development-request@drupal.org
You can reach the person managing the list at development-owner@drupal.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of development digest..."
Today's Topics:
1. Importing CCK content types during module installation (E.J. Zufelt) 2. Re: Importing CCK content types during module installation (Randy Fay) 3. Re: Importing CCK content types during module installation (Stefan Borchert)
----------------------------------------------------------------------
Message: 1 Date: Tue, 7 Sep 2010 07:10:40 -0400 From: "E.J. Zufelt" <lists@zufelt.ca> Subject: [development] Importing CCK content types during module installation To: development@drupal.org Message-ID: <2D998BE9-456A-4AEA-84DF-EB8780BA72EC@zufelt.ca> Content-Type: text/plain; charset="us-ascii"
Good morning,
I am looking for a method of importing CCK content types during module installation. From what I have read this seems difficult, or perhaps impossible? Any nudge in the right direction would be greatly appreciated.
Programmatic CCK content type creation http://www.openbandlabs.com/blog/2009/06/programmatic-cck-content-type-crea tion
* This seems to indicate that this is not possible because of Batch API. It provides thorough code for importing CCK content types, but mentions that it cannot be used in hook_install()
drupal_execute is incompatible with batch API http://drupal.org/node/297972
* I didn't read the entire issue, but this seems fixed in 6.x
pausing a batch process for form submission http://drupal.org/node/283594
* I tried the recommendation here, but it didn't seem to work. The recommendation is to save a copy byVal of $batch_get(), to set &$batch_get() = NULL, to perform the form execution, then to replace &batch_get() with the saved copy.
When I try the import described in the first article within myModule_install() I get no errors, but my content type does not exist when I check the list of content types. If I use the suggestion about fooling Batch API into thinking there is no batch running in combination with the example in the first article I get the same result. The module is enabled but the content type doesn't exist.
This makes me think that I will have to programmatically create, rather than import, the CCK content type, which I am not opposed to. Any references to tutorials or book chapters that do a good job at explaining this would be appreciated.
Thanks in advance, Everett Zufelt http://zufelt.ca
Follow me on Twitter http://twitter.com/ezufelt
View my LinkedIn Profile http://www.linkedin.com/in/ezufelt
participants (1)
-
Reiner Miericke