There was a need to move the import directory cleaning procedure from catalog import step to the authorization step.

Comments

WalkingDexter created an issue. See original summary.

  • sin committed bbc7b61 on 7.x-1.x authored by WalkingDexter
    Issue #2796433 by WalkingDexter: Replace clear import directory code to...
sin’s picture

Status: Needs review » Patch (to be ported)

Committed, thnx!

walkingdexter’s picture

Backported patch for Drupal 6.

walkingdexter’s picture

Status: Patch (to be ported) » Needs review

  • sin committed 18e8023 on 7.x-1.x
    Issue #2796433 by sin: Fix delete never happened
    
sin’s picture

The code was:

      _commerceml_success(session_name() . "\n" . session_id() . "\n");
      _commerceml_clear_import_directory();

So _commerceml_clear_import_directory() was never called due to _commerceml_success() call to drupal_exit().

That is why only archive import worked. File by file import was broken due to clear never executed and files always appended.

I fixed it for 7.x swapping these two code lines.

sin’s picture

Right now the exchange may fail if file_unmanaged_delete_recursive() returns false, for example if it has no access to delete some files. So pls test before use on production sites.

sin’s picture

Status: Needs review » Patch (to be ported)
sin’s picture

Moved cleanup to init stage with 'commerceml_need_clear_import_directory' flag check. The flag is set on successful import only.