• Resolved macheteyeti

    (@macheteyeti)


    Since switching web hosts, our documents are no longer available at their permalinks.

    I tried following the guidance in this other thread which seemed relevant, but it has not gotten me anywhere. Here is our JSON, which meant little to me:

    {
    "namespace": "wpdr/v1",
    "routes": {
    "/wpdr/v1": {
    "namespace": "wpdr/v1",
    "methods": [
    "GET"
    ],
    "endpoints": [
    {
    "methods": [
    "GET"
    ],
    "args": {
    "namespace": {
    "default": "wpdr/v1",
    "required": false
    },
    "context": {
    "default": "view",
    "required": false
    }
    }
    }
    ],
    "_links": {
    "self": [
    {
    "href": "https://livewellandfully.com/wp-json/wpdr/v1"
    }
    ]
    }
    },
    "/wpdr/v1/correct/(?P[\d]+)/type/(?P
    [\d]+)/attach/(?P[\d]+)": {
    "namespace": "wpdr/v1",
    "methods": [
    "PUT"
    ],
    "endpoints": [
    {
    "methods": [
    "PUT"
    ],
    "args": {
    "id": {
    "required": true
    },
    "code": {
    "required": true
    },
    "parm": {
    "required": true
    }
    }
    }
    ]
    }
    },
    "_links": {
    "up": [
    {
    "href": "https://livewellandfully.com/wp-json/"
    }
    ]
    }
    }

    Please let me know if you have any insights after watching this Loom: https://www.loom.com/share/451ff923e23e4351a56d23bd7270a075

    I neglected to mention in the Loom that media uploads to the native WP library are working fine

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor nwjames

    (@nwjames)

    @macheteyeti,

    I hope that you have been able to resolve this already, but if not, given your statement that you can upload ordinary media, but get the message that you cannot write to the directory when you try to upload a document, then I would guess that you do not have the correct value for the document directory after the migration.

    Please go to your Admin Settings -> Media page. There are a number of values contained in the section Uploading Files.

    One of these will be labelled Document Upload Directory. Please check that this is the correct value for your migrated site.

    Separately, you have questions about the year/month combination for being a) part of file location; and b) on the permalink.

    These are completely independent and one has no impact on the other, though obviously they are related.

    For the file location, this is determined by the option Organise my uploads into month- and year-based folders. Your uploads (both Media and Documents will use sub-directories or not. If used, the file will be stored there and the attachment postmeta will contain the sub-directory name. That’s it.

    For the permalink, the year and month are used as part of the search criteria to find the document post record to be displayed. Arguably since the unique defining criteria is the post name, and the year/month can only serve to NOT find the record when given as all conditions need to be met for the record to be found. In fact there was a bug related to this. This was one of my motivations to propose the option Document Date in Permalink in version 3.5 that removes the year/month from the permalink.

    As a final thought, strictly the year/month on the permalink is that of the Document record and the year/month of the uploaded Attachment record. If they are uploaded around midnight on the 1st of the month, they can validly have different values.

    Hope this helps and clarifies,

    Neil James

    Plugin Contributor nwjames

    (@nwjames)

    @macheteyeti,

    Some time has passed and it appears that the site is working now so I will mark this as resolved.

    Regards,

    Neil James

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

The topic ‘Post-Migration Breakage’ is closed to new replies.