Hi,

i installed swfttools, but it shows no cck file types.
"admin/settings/swftools/cck" shows me a error message "warning: Invalid argument supplied for foreach() in /.../swftools/swftools.admin.inc on line 480.

Comments

Stuart Greenfield’s picture

Have you created a CCK based content type yet? I think the bug might be that no content types are being returned, and that causes the status page to fail.

Once you've created a CCK based content type I think it will work ok. I'll try to look at this properly later.

Thurgi’s picture

Nope, i created a normal cck file type, but swftools won't create the media filetypes

Stuart Greenfield’s picture

I'm not sure what you mean when you say swftools won't create the media filetypes? SWF Tools doesn't create any types, it just provides formatters that you use to format filefields.

Have you checked the documentation?

Thurgi’s picture

I have no idear what happened, but the error is gone and everything works fine now.

Stuart Greenfield’s picture

Glad it's working now!

Having looked at the code I'm going to test it out when there are no CCK content types as I think it might break the admin page, so I'll leave the thread open for a while as I test it.

lyricnz’s picture

The error

"warning: Invalid argument supplied for foreach() in .../sites/all/modules/swftools/swftools.admin.inc on line 480."

happens when you don't have file-field enabled:

  $field_types = _content_field_types();
  ...
  foreach ($field_types['filefield']['formatters'] as $formatter_name => $formatter_info) {
    $options[$formatter_name] = $formatter_info['label'];
  }

This is a bug - the existence of field_types['filefield'] should be checked first.

Stuart Greenfield’s picture

Fixed on DRUPAL-6--3. Good spot! Thanks!!

lyricnz’s picture

Np.

Of course, SWF tools should really support fields other than filefield: eg #465708: Add support for CCK Link fields to external files :)

Stuart Greenfield’s picture

Of course, SWF tools should really support fields other than filefield

Absolutely, and I've just downloaded the link module ready to check out the patches and code in #465708: Add support for CCK Link fields to external files

All being well 6.x-3.x will have filefield, text field and link field support to get things going...

Stuart Greenfield’s picture

Status: Active » Needs review

Changing to needs review as this issue is fixed pending release of SWF Tools 6.x-3.x