[development] development Digest, Vol 93, Issue 13
Reiner Miericke
reiner at miericke.net
Tue Sep 7 14:24:18 UTC 2010
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 at drupal.org:
> Send development mailing list submissions to
> development at 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 at drupal.org
>
> You can reach the person managing the list at
> development-owner at 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 at zufelt.ca>
> Subject: [development] Importing CCK content types during module
> installation
> To: development at drupal.org
> Message-ID: <2D998BE9-456A-4AEA-84DF-EB8780BA72EC at 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
>
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.drupal.org/pipermail/development/attachments/20100907/53bcdba
> 3/attachment-0001.html
>
> ------------------------------
>
> Message: 2
> Date: Tue, 7 Sep 2010 13:29:49 +0200
> From: Randy Fay <randy at randyfay.com>
> Subject: Re: [development] Importing CCK content types during module
> installation
> To: development at drupal.org
> Message-ID:
> <AANLkTimbvo=-7X54U=NX2VD9FcanA1-gBORKgonoLSLK at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi Everett -
>
> The current canonical way of adding content types now is with the Features
> module. (The old ways you mention do work, but Features is *so* much
> better)
>
> So you can just make your new module dependent on a feature that defines
> the content type you need.
>
> -Randy
>
> On Tue, Sep 7, 2010 at 1:10 PM, E.J. Zufelt <lists at zufelt.ca> wrote:
> > 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-cr
> >eation
> >
> > * 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
> >
> >
> >
> >
> >
> >
> > Good morning,
>
> Hi.
>
> > 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.
>
> If you use the Features module (http://drupal.org/project/features) you can
> create
> the content type on a test site and export it using Features and cTools.
> With this exported Feature you have a module that creates exactly this
> content type
> during installation.
> Additionally you can export variables and lots of other settings with
> Features.
>
> hth,
>
> Stefan
>
>
>
> ------------------------------
>
More information about the development
mailing list