Hi,

I love this module since it offers the by far most robust way to upload images into Drupal; however, I'm considering to switch from Image module to CCK Imagefield; are there any plans to add support for CCK Imagefield or Imagefield-based Image nodes to the "Image Publishing" module? Would this even be possible?

Thanks a lot & greetings, -asb

Comments

egfrith’s picture

Hello asb,

good to know you like the module!

Re your query, I haven't got any plans to support CCK Imagefield or Imagefield-based nodes at present, though I'm open to suggestions.

One point to bear in mind is that there is a long-term effort to port image module to using Imagefield, though this seems to have stalled for now: #232129: Merge Image with Imagefield/cache in 2.x . If this did come to fruition, would that be OK for you?

If not, then I can imagine that it would be possible to support upload into CCK nodes, however, the administrator would have to specify the node type that images are placed in, and the mapping between the fields provided by the client (i.e. caption and extrafield.description) and the CCK fields of that node type.

I don't particularly like this idea, as it adds complexity to the module, both for the users and maintainers. But if there is a need for it and if someone were to provide a good patch, I'd be happy to include it.

What do you think?

asb’s picture

Hi egfrith,

thanks for your reply! There's already a migration script that helps with the conversion process from image module to a certain imagefield-based image node content type; that could be a "defined state" for a imagefield image content type which "Image Publishing" module could support. There's also a Node Convert module that does some fascinating stuff in matching CCK fields from one node type to another; maybe someone could utilize parts of this code for the "Image Publishing" module to get some flexibility in handling CCK-based content types.

However, I'm not able to provide a patch myself, but I'd add myself to a list of sponsors for such a feature. Let's see if there's demand for bulk uploading images into CCK imagefield nodes - as far as I've seen, no working solution for that exists yet ;)

Can we keep this request active in the meantime, or would you prefer to set it to "postponed" or "by design"?

Thanks & greetings, -asb

egfrith’s picture

Hello asb,

thanks for the helpful information.

I suppose that one possibility might be to hook into the node convert module to convert image nodes to the CCK node type as soon as they are created, though this does seem a bit messy.

I don't think we could rely on the name of the node type and the field names being the same as in the conversion script you mentioned - they would have to be configured. But this shouldn't be very difficult - a form would be required and some variables would have to be stored. And the module would have to hook into whatever function is called when a node type is deleted.

The the code in _image_pub_image_add() would have to be altered to reflect the node type and field names. And we would have to work out how to upload images to imagefields programatically.

At the moment my priority with the module is to fix bugs, but I'm very happy to keep this issue active and see who contributes to it.