Skip to content

TourML Export fails on Windows #45

@IllyaMoskvin

Description

@IllyaMoskvin

On L397-398 of tap.export.inc, there is an exec() call to move the *-bundle.zip from /tmp to the files directory. I think the command used will only work on Linux, or at least, it was what caused the TourML Export functionality to break on my WAMP stack. Replacing these two lines with the following rename() call fixed the issue:

rename( str_replace('\\', '/', $file_path) , str_replace('\\', '/', drupal_realpath($dest) ) );

There might be a Drupal function, maybe in one of the required modules, that accomplishes the same thing with more elegance. From cursory examination, it seems that $output and $return_val from the original exec() call aren't used elsewhere, so I thought it was safe to discard them, but it'd be good if someone more familiar with the module could confirm that this is the case.

Without the str_replace() to force forward-slashes in paths, rename() would bug out on Windows. Without them, it removed bundle files from my temporary directory, but they never arrived in sites\default\files\tourml_bundle. (I'm still not sure where they all went.)

I just tested this change on a Linux server, and the bundle export works as expected.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions