• I have a problem with files that were uploaded and registered other than through the media menu, using a custom field in my templates instead.
    It does move the file physically to the new folder but the meta in the database contains the original file path both before and after moving. I cannot see any difference in the database entry from similar files uploaded directly.

    I use My-Meta-Box from bainternet to upload such files. using this line added to functions.php:
    require_once( “meta-box-class/my-meta-box-class.php” );
    And lines like his to upload the files when editing a page:
    $my_meta102->addFile($prefix.’programme_button_url’,array(‘name’=> ‘Programme (pdf): (only made available on day after last performance)‘,’ext’ =>’pdf’,’mime_type’ => ‘application/pdf’));

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter idlee69

    (@idlee69)

    Any response on this? It seems a simple matter to search the database more thoroughly. I had the same issue with the plugin ‘WP Media folders’ by Damien Barrère and he fixed it very quickly. This plugin looks better as it is easier to use without getting the overburdened package ‘WP Media folder’ that is needed to link with it for easier use.

    Plugin Author Katsushi Kawamori

    (@katsushi-kawamori)

    Media -> Make folder&Settings -> Make folder
    “If you created or deleted a folder in another way, you can leave the field blank and press the following button to apply the changes.”

    “Make folder&Save changes” button press.

    Thread Starter idlee69

    (@idlee69)

    The folders are not the problem, it’s the database not updating with the new path even when these images are moved in media. The files do move physically but the meta in the database is not updated.

    Plugin Author Katsushi Kawamori

    (@katsushi-kawamori)

    Do you need an action hook when moving media?

    Thread Starter idlee69

    (@idlee69)

    I don’t know. My knowledge is not that deep into wordpress. All I can say is that the file paths are not being updated in the database when they are moved in the media management.

    Thread Starter idlee69

    (@idlee69)

    It appears that the filenames giving the problem are stored as part of an array with the label ‘url’. Can this be allowed for in your plugin?

    Here is part of an export from the database:
    meta_id;”post_id”;”meta_key”;”meta_value”
    74045;”4609″;”pages_poster_button_url”;”a:2:{s:2:””id””;s:4:””6084″”;s:3:””url””;s:92:””https://localhost/faringdondramatic.org.uk/wp-content/uploads/farndale-avenue-2018-poster.pdf””;}”

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘File path not updated in database after folder move’ is closed to new replies.