• Resolved dansart

    (@dansart)


    Hi
    I just installed the plugin and I noticed that the loading of files and folders fails.
    The console logs a 404:

    https://localhost/index.php?rest_route=/mstv/v1/browser?folder_id=&order_by=display_name&order=ASC&page=1&per_page=50

    I did some digging and it turns out, that happens when pretty permalinks are not setup.
    When changing the buildApiUrl function in admin-app.js to the following, everything works.

            buildApiUrl(endpoint) {
    const base = String(mstvConfig.restUrl || '').replace(/\/+$/, '');
    const path = String(endpoint || '').replace(/^\/+/, '');
    if (base.includes('?')) {
    const qIdx = path.indexOf('?');
    if (qIdx === -1) {
    return
    ${base}/${path};
    }
    return ${base}/${path.substring(0, qIdx)}&${path.substring(qIdx + 1)};
    }
    return ${base}/${path};
    },

    Also I noticed that there is not feedback why a file could not be uploaded, when it is too big. It just gives the message: No file uploaded.

    Best Daniel

    • This topic was modified 5 days, 10 hours ago by dansart.
Viewing 1 replies (of 1 total)
  • Plugin Author Mikesoft

    (@thestreamcode)

    Hi Daniel,

    thank you very much for the detailed report and for taking the time to investigate the issue.

    You were absolutely right: the problem happened on sites using plain permalinks, where WordPress builds REST API URLs with the rest_route query parameter. TeamVault was appending endpoint query parameters incorrectly in that case, which caused the browser endpoint to return a 404.

    This has been fixed in version 2.0.2, which is now available on WordPress.org.

    I also improved the upload error message when PHP rejects a file because it is too large before TeamVault can validate it.

    I tested the fix on a local WordPress install with plain permalinks and confirmed that the folders/files endpoint now loads correctly.

    Thanks again for the helpful report.

    Best,
    Michael

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.