Going to admin/content/types/export, selecting content type, selecting all fields and Export and nothing happen (again, the same page).

Comments

kenorb’s picture

_POST after submit:

array
  'type_name' => string 'restauracja' (length=11)
  'op' => string 'Export' (length=6)
  'form_build_id' => string 'form-9bf7f346abaeca891b9d3cefd6992f14' (length=37)
  'form_token' => string '1e95ca7484ba3d97f494578a65cc8c1d' (length=32)
  'form_id' => string 'content_copy_export_form' (length=24)

form_state after processing function content_copy_export_form_submit($form, &$form_state):

array
  'storage' => 
    array
      'step' => int 1
  'submitted' => boolean true
  'values' => 
    array
      'type_name' => string 'restauracja' (length=11)
      'op' => string 'Eksportuj' (length=9)
      'submit' => string 'Eksportuj' (length=9)
      'step' => int 1
      'form_build_id' => string 'form-ba100faaf1e64dd733252ceec41c99ea' (length=37)
      'form_token' => string '1e95ca7484ba3d97f494578a65cc8c1d' (length=32)
      'form_id' => string 'content_copy_export_form' (length=24)
  'clicked_button' => 
    array
      '#type' => string 'submit' (length=6)
      '#value' => string 'Eksportuj' (length=9)
      '#post' => 
        array
          'fields' => 
            array
              'field_opening_hours' => string 'field_opening_hours' (length=19)
              'field_typ_restauracji' => string 'field_typ_restauracji' (length=21)
              'field_typ_kuchni' => string 'field_typ_kuchni' (length=16)
              'field_link' => string 'field_link' (length=10)
              'field_email' => string 'field_email' (length=11)
          'type_name' => string 'restauracja' (length=11)
          'op' => string 'Eksportuj' (length=9)
          'form_build_id' => string 'form-011d1c32d5a7a87f622f89f8260b74a0' (length=37)
          'form_token' => string '1e95ca7484ba3d97f494578a65cc8c1d' (length=32)
          'form_id' => string 'content_copy_export_form' (length=24)
      '#programmed' => boolean false
      '#tree' => boolean false
      '#parents' => 
        array
          0 => string 'submit' (length=6)
      '#array_parents' => 
        array
          0 => string 'submit' (length=6)
      '#weight' => float 0.001
      '#processed' => boolean false
      '#description' => null
      '#attributes' => 
        array
          empty
      '#required' => boolean false
      '#input' => boolean true
      '#name' => string 'op' (length=2)
      '#button_type' => string 'submit' (length=6)
      '#executes_submit_callback' => boolean true
      '#process' => 
        array
          0 => string 'form_expand_ahah' (length=16)
      '#id' => string 'edit-submit' (length=11)
  'redirect' => null
  'rebuild' => boolean true

It looks like it's still step 1?

kenorb’s picture

Category: support » bug

Temporary solution for me
to change this (in content_copy.module file):

  if ($step == 2 && !($groups) && !($exportable_fields)) {

to that one:

  if ($step == 2 && !($groups)) {

But the problem is that it's exporting all fields without asking (for me it's ok).

Remove the last condition.
For me it should be something like !empty($exportable_fields), but even this one doesn't work.
I think there is some problem, because $exportable_fields contain the array with fields even the user haven't select the field yet, weird.

Result of following code:

  // If a content type has been selected and there are no fields or groups to select,
  // jump straight to export.
  drupal_set_message('before:'.$step.' '.print_r($exportable_fields,true));
  if ($step == 2 && !($groups) && !($exportable_fields)) {
    $step = 3;
  }
  drupal_set_message('after:'.$step);
before:1 Array ( )
after:1
before:2 Array ( [0] => field_link [1] => field_email )
after:2

P.S. I couldn't reproduce on fresh Drupal.

damienmckenna’s picture

I've started running into this issue too.. it worked fine for a while and now is doing the endless loop mentioned above.

In order to try to work out what's going on, I added the following after the following after the include_once() lines of content_copy_export_form():

  print("<pre style=\"text-align:left;\">");print_r($form_state);print("</pre>");

First run through:

Array
(
    [storage] => 
    [submitted] => 
    [post] => Array
        (
        )

)

The list of content types are now listed.

After submitting the form it prints:

Array
(
    [storage] => 
    [submitted] => 
    [post] => Array
        (
            [type_name] => webform
            [op] => Export
            [form_build_id] => form-7984ce59e18e5802aa6891df8459224d
            [form_token] => 6a6bb6cead1dba671496897ce9c6e767
            [form_id] => content_copy_export_form
        )

)
Array
(
    [storage] => Array
        (
            [step] => 1
        )

    [submitted] => 1
    [values] => Array
        (
            [type_name] => webform
            [op] => Export
            [submit] => Export
            [step] => 1
            [form_build_id] => form-b1ca4b6c2dd7e28142b288daf289e96a
            [form_token] => 6a6bb6cead1dba671496897ce9c6e767
            [form_id] => content_copy_export_form
        )

    [clicked_button] => Array
        (
            [#type] => submit
            [#value] => Export
            [#post] => Array
                (
                    [type_name] => webform
                    [op] => Export
                    [form_build_id] => form-7984ce59e18e5802aa6891df8459224d
                    [form_token] => 6a6bb6cead1dba671496897ce9c6e767
                    [form_id] => content_copy_export_form
                )

            [#programmed] => 
            [#tree] => 
            [#parents] => Array
                (
                    [0] => submit
                )

            [#array_parents] => Array
                (
                    [0] => submit
                )

            [#weight] => 0.001
            [#processed] => 
            [#description] => 
            [#attributes] => Array
                (
                )

            [#required] => 
            [#input] => 1
            [#name] => op
            [#button_type] => submit
            [#executes_submit_callback] => 1
            [#process] => Array
                (
                    [0] => form_expand_ahah
                )

            [#id] => edit-submit
        )

    [redirect] => 
    [rebuild] => 1
)

This prints a list of custom fields for this content type.

Submitting the above results in the following:

Array
(
    [storage] => 
    [submitted] => 
    [post] => Array
        (
            [fields] => Array
                (
                    [field_field1] => field_field1
                    [field_field2] => field_field2
                )

            [type_name] => webform
            [op] => Export
            [form_build_id] => form-629b2cab4c2e20d94a948d245f876b4f
            [form_token] => 6a6bb6cead1dba671496897ce9c6e767
            [form_id] => content_copy_export_form
        )

)
Array
(
    [storage] => Array
        (
            [step] => 1
        )

    [submitted] => 1
    [values] => Array
        (
            [type_name] => webform
            [op] => Export
            [submit] => Export
            [step] => 1
            [form_build_id] => form-bdb8b58a6575e1091bd003e24b96336a
            [form_token] => 6a6bb6cead1dba671496897ce9c6e767
            [form_id] => content_copy_export_form
        )

    [clicked_button] => Array
        (
            [#type] => submit
            [#value] => Export
            [#post] => Array
                (
                    [fields] => Array
                        (
                            [field_field1] => field_field1
                            [field_field2] => field_field2
                        )

                    [type_name] => webform
                    [op] => Export
                    [form_build_id] => form-629b2cab4c2e20d94a948d245f876b4f
                    [form_token] => 6a6bb6cead1dba671496897ce9c6e767
                    [form_id] => content_copy_export_form
                )

            [#programmed] => 
            [#tree] => 
            [#parents] => Array
                (
                    [0] => submit
                )

            [#array_parents] => Array
                (
                    [0] => submit
                )

            [#weight] => 0.001
            [#processed] => 
            [#description] => 
            [#attributes] => Array
                (
                )

            [#required] => 
            [#input] => 1
            [#name] => op
            [#button_type] => submit
            [#executes_submit_callback] => 1
            [#process] => Array
                (
                    [0] => form_expand_ahah
                )

            [#id] => edit-submit
        )

    [redirect] => 
    [rebuild] => 1
)

I'll see if I can dig up anything else.

damienmckenna’s picture

Digging around some more, I've noticed that the second call to content_copy_export_form() happens after there's a call to drupal_rebuild_form().. why would it need to do that?

kenorb’s picture

Status: Active » Fixed

I've found the problem.
It's because of not fully working cache.
All Drupal forms and states are kept in cache table, even cache is disabled, Drupal still wanted to load them from cache (even form was not correct).
Before I'd to disable cache_menu and cache_form caching manually, because packets were too big (and I couldn't change the limit) using instruction here:
#321154: can I disable cache_menu? how?
That cause the problems and Drupal was trying to rebuild it twice.
Description of problem here as well: http://drupal.org/node/93779#comment-1254794

So I've installed #361967: Increase MAX_JOIN_SIZE and MAX_ALLOWED_PACKET settings in system.install
and http://drupal.org/project/fastpath_fscache
for 6.x
And now it's working fine.

Thanks for your help.

kenorb’s picture

Category: bug » support
damienmckenna’s picture

kenorb: the db changes did not make any difference for my setup, so I definitely would not mark this as being resolved.

kenorb’s picture

Basically it's Drupal core issue, because I've disabled cache_form caching (because of mysql errors) and Drupal tried to take this form via:

    if (isset($_POST['form_id']) && $_POST['form_id'] == $form_id && !empty($_POST['form_build_id'])) {
      $form = form_get_cache($_POST['form_build_id'], $form_state);
    }

without checking if state of this form was kept in cache or not and that's why $step couldn't change to 3.
It's not related to CCK, but when disabling form cache, Drupal freaking out causing different very weird workflows for some modules.

damienmckenna’s picture

After doing a reinstall and updating all modules to the latest revisions, this is still a problem.

kenorb’s picture

Status: Fixed » Postponed (maintainer needs more info)

DamienMcKenna: so you saying that you have the same problem?

damienmckenna’s picture

Yes. D6.10, the problem persists with both the most recent stable release of CCK and the latest dev release. I'll see if I can do some more testing to see if maybe a module is breaking something..

kenorb’s picture

I thought it was caused by my cache (because in this time everything wasn't work for me), but maybe there is some other problem.
But when I've check that recently, it suppose to work.
Do you using some external cache? Did you tried to disable it?

damienmckenna’s picture

Ok.. I'm starting to wonder if a bug gets its way into the system and causes this. I rebuilt my site entirely from scratch using install profiles, added back in all the same fields using the helper functions from install_profile_api, and now I can export the content types again. Go figure.

damienmckenna’s picture

Of course then I do another deployment and it stops working. Go figure.

kenorb’s picture

Can you check if you don't have any errors in watchdog like too big cache_form packets?
Did you try to disable the cache?
Because I'm sure that it's related to caching forms and basically Drupal can't get your form from cache_form table.

damienmckenna’s picture

There are no errors in dblog at all, the only messages are regarding actions and widgets that were added during the install process.

damienmckenna’s picture

After a few clean re-installs from an install profile and some module updates, right now I have it half-working - it outputs the basic details and the groups but not the individual fields...

kenorb’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
damienmckenna’s picture

Everyone should be using Features anyway ;)