• Resolved hhthedude

    (@hhthedude)


    when I look at the log for my webdav access, it shows the username after the directory. That shouldn’t happen, and it causes an error as the username is not part of the path.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author threadi

    (@threadi)

    Hello,

    thanks for your question.

    Which platform are you using for the WebDAV connection? I just successfully tested it again with NextCloud, for example. What does your connection configuration look like?

    If you want to customize the connection, various PHP hooks are available. For example, you can use the filter efmlwd_service_webdav_path to adjust the path. Depending on the feedback I receive (like yours here), I might add further options to allow for different WebDAV configurations.

    Thread Starter hhthedude

    (@hhthedude)

    I’m using pCloud as my source, and it’s a very simple format. The server is: https://ewebdav.pcloud.com, and the path is /CHaP Photo Albums/.

    But when I look at the log file, it shows https://ewebdav.pcloud.com/CHaP Photo Albums/<user name>

    Plugin Author threadi

    (@threadi)

    I’ve heard of pCloud before, but I’ve never used it because it’s a paid service. But it looks like a great solution you’ve got there 🙂

    There’s a quick fix that should work for you, using this PHP hook:

    add_filter( 'efmlwd_service_webdav_path', function( $path, $fields ) {
    return str_replace( $fields['login']['value'] . '/', '', $path );
    }, 20, 2 );

    You would need to add it to the functions.php file of your child theme or to your project via a code snippet plugin. After that, the path will be used without the login name.

    I’ve made a note here to make the path more configurable in future versions.

    Thread Starter hhthedude

    (@hhthedude)

    Can you clarify “child theme”? When I try copying that line to the functions.php of my theme, when trying to save I get this error: Unclosed ‘(‘

    Thread Starter hhthedude

    (@hhthedude)

    Ignore my previous post. When I copied it from this location it was formatted a little differently, and it was saved ok. Now let me check if it works.

    Thread Starter hhthedude

    (@hhthedude)

    Is this error in the log something to worry about? The external directory does not have any configuration for synchronization. webdav

    Apologies, I know this is a new topic, and can open a new item if needed.

    Plugin Author threadi

    (@threadi)

    That sounds like a PHP syntax error to me. Take a close look at what you copied and what you pasted. There’s probably a character missing somewhere in your file.

    Thread Starter hhthedude

    (@hhthedude)

    is this supposed to sync directories and sub-directories? Although the sync runs ok now, nothing is pulled in.

    Plugin Author threadi

    (@threadi)

    Unfortunately, no, not yet. The reason is that WordPress itself does not (yet) support subdirectories. Importing files from such structures could cause issues, as the directory structure cannot be preserved. To make it worse, there might be files with identical filenames in those directories – you cannot store duplicate files in the media library, and you wouldn’t be able to tell them apart.

    I have an issue regarding this for ZIP files, but it certainly applies to any external source. One idea for these directory structures is to use one of the many directory plugins. Then you could map them using that.

    If you’re already interested in this, what would you expect these directory structures to look like in the Media Library? Then I could take that into account for further development.

Viewing 9 replies - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.