WordPress.org

Ready to get started?Download WordPress

Forums

Plugin relocate-upload - Not quite working in 2.7 (62 posts)

  1. Taschmahal
    Member
    Posted 5 years ago #

    I'm sorry. I downloaded the latest dev version, and there it works fine!

  2. partypageusa
    Member
    Posted 5 years ago #

    I am using version 2.8 and all is fine until I get to the upload screen where I pick which folder to move the file to, I am getting a "Failed" message.

  3. CrazySerb
    Member
    Posted 5 years ago #

    Hmm... I keep getting the same error as well, even with the dev 0.13 version on WP2.8.

    On the plugin settings page I can't get rid of the red borders (signifying that the folder is not-writable or something) and thus on the upload screen I keep getting Failed message as well.

    And I know those folders exist, are writable, and the full path is correct.

    What gives?

  4. CrazySerb
    Member
    Posted 5 years ago #

    Hey Alan, can I pay you or get in touch with you directly somehow to get this plugin working on 2.8 and on my server?

    I'll gladly do that... just let me know how to go about it.

  5. bezart
    Member
    Posted 5 years ago #

    Hi guys, I have the same problem with WP 2.8 :( I really like this plugin and I need it for my work, so if somebody can help with this issue I'll be very appreciated

  6. alanft
    Member
    Posted 5 years ago #

    damn - not bothered to check this one in 2.8. i will have a look over asap - over the weekend if i can. it may well be just a few simple tweaks.

    very nice of you to offer payment! not necessary, but I can point you at the main plugin i maintain

    http://wordpress.org/extend/plugins/widget-logic/

    which has a charity collection in the donate link

  7. alanft
    Member
    Posted 5 years ago #

    i tried it last night and it worked ok.

    CrazySerb - have you checked that the folders are actually modifiable by WP? check the folder permissions.

  8. CrazySerb
    Member
    Posted 5 years ago #

    Oh yeah, that was the first thing I checked (they're all at 777). Trust me, I've spent like 2 hours going back and forth with all the possible settings, permissions, pieces of code that I thought would make a difference - nothing.

    Any way you can get a hold of me at crazyserb[at]gmail.com? The reason why I offered to pay you for this is because this is a missing link in this big puzzle of a website I've put together for a friend, and without your plugin in place, working properly, there's gonna be a lot of issues with the alternate method of uploading attachments to different folders. And I'd rather pay someone for their time spent looking into this for me and fixing it (someone who knows what the issue might be) than me going with a Plan B, a workaround.

  9. alanft
    Member
    Posted 5 years ago #

    i've mailed you

  10. bezart
    Member
    Posted 4 years ago #

    Hi all, have you found a solving of this issue? I'm using RU v 0.13, WP 2.81. On «Relocate Upload – Locations» page I don't have any red borders around my location fields, but when I'm choosing destination folder on «Media library» page, I have «failed» message :( I tried different locations and different permissions for folders, but it doesn't work. If you have any thoughts why is this happening, please mail me at bezz.mail[at]gmail.com And thank you Alan for all your help.

  11. alanft
    Member
    Posted 4 years ago #

    some starting points for troubleshooting

    find an example media item and let me know the "File URL" as listed in the Edit Media page (Click edit on that item in the media library list)

    Then from the relocate upload options tell me what the path in bold after "Paths are relative to the blog root" is and also what the 'default location' path is (listed at the top in grey)

    also, it would be good to know what your method for uploading media items is, in case it's unusual

  12. fn1
    Member
    Posted 4 years ago #

    Alan thank you for sharing your Relocate Upload plugin. It's almost working for me.

    I'm using RU 0.13 and WP 2.8:

    1) I can upload files to the Media Library, Select Edit and successfully 'move' them to alternate folders, as configured in Settings -> RU.

    2) When I reselect Edit in the Media Library, the File URL reflects the new directory path to the recently moved file. So far so good!

    3) And yes, I can also delete 'moved' files thru the Media Library interface.

    However I have not been able to list the 'moved' files using the Media Library Filter button. Yes, the alternate folders configured in RU show up in the pop-up next to the 'Filter' button in the Media Library. But selecting any value other than 'All Folders" returns an empty list of files.

    So thanks to RU I can now upload files and move them to alternate folders, but I can never list these files in a specific alternate folder. Only if I specify I want to filter on 'All Folders', do I get a listing of files. Of course, by specifying a 'filter' of 'All Folders', I lose the advantage of having multiple folders to organize the Media Library. I can't list the contents of these Alternate folders. I can only list the contents of all the folders. And yes it works -- I see all the files listed including those that have been moved by RU to alternate folders.

    Do you have any suggestions as to where I should focus my debugging efforts? Or any information that I could share on this forum to help provide insight into why I can't list the files in the alternate folders?

    thank you!

  13. alanft
    Member
    Posted 4 years ago #

    ok, well the way that filter works is to narrow down the list to items whose 'guid' matches the folder path you select. so the most obvious thing that might go wrong is that the guid is not changing appropriately when the file is originally moved.

    i'm not 100% clear these days when the 'guid' is actually used, but it should be the "File URL" you see when you click edit on an item. BUT wordpress may be constructing that from somewhere. have you the SQL skills to find the 'guid' field of a particular moved media item?

    also it would be good to know the paths you see and have set on the RU options page.

    Cheers

  14. fn1
    Member
    Posted 4 years ago #

    Hi Alan,
    Thank you for the speedy response.
    As reported in my initial post "(2) when I reselect Edit in the Media Library, the File URL reflects the new directory path to the recently moved file."

    I am now re-checking the MySQL _posts table... Ahhh!

    OK, so I confirm that the GUID is updated when a file is moved using RU 0.13, and the updated GUID in the MySQL _posts Table matches exactly what is reported in the Media Library Edit GUI's "File URL" field. And these updated GUIDs do indeed work - connecting to them in a browser displays the media file.

    However I defined the RU folders in the RU 01.3 Settings page as _peer_ to wp-content/:

    Default Location: /dev/ddnt/wp-content/uploads
    Directory A: /dev/ddnt/dir1/dir2/
    Directory B: /dev/ddnt/dir3/dir4/

    The wordpress URL in the WP 2.8 General settings is: http://mydomain.com/dev/ddnt

    But the GUID entry in the _posts table and displayed in the Media Directory Edit window, both write the URL as if dir1 and dir3 were subfolders _inside_ the wp-contents directory, viz:

    http://mydomain.com/dev/ddnt/wp-content/dir1/dir2/filea.pdf
    http://mydomain.com/dev/ddnt/wp-content/dir3/dir4/fileb.jpg

    And yet these URL strings still work!? Hmm. Is there some URL rewriting going on at my end? Regardless, I'm assuming that I need to move dir1 and dir3 _inside_ wp-content directory. I'm trying that now...

  15. fn1
    Member
    Posted 4 years ago #

    So sorry about the confusing previous note - I left out a directory level out in the previous explanation. Anyhooow, here's my update...

    Question: Should the RU 0.13 folders be sub-folders of 'wp-content/uploads/'?
    I have setup two sub-folders, 'dir1' and 'dir2', in 'uploads' and defined these in the RU 0.13 settings.

    I have simplified my setup, viz:

    1) WordPress URL in the WP 2.8 General settings is: http://mydomain.com/dev/ddnt

    2) RU 01.3 Settings
    Default Location: /dev/ddnt/wp-content/uploads
    Directory A: /dev/ddnt/wp-content/uploads/dir1/
    Directory B: /dev/ddnt/wp-content/uploads/dir2/

    3) Media Library GUI lets me move files from the 'Default Location' to 'Directory A' or 'Directory B'

    4) The Media Library Edit view shows that files I move have updated File URLs:
    http://mydomain.com/dev/ddnt/wp-content/uploads/dir1/file1.jpg

    5) WP 2.8 _posts Table shows that the GUID is the exact same string as (4). So RU _is_ updating the GUID, and this is being reported correctly in the Media Library Edit view.

    6) Media Library GUI filter "Directory A" returns NO files.
    Media Library GUI filter "All folders" returns ALL files including 'file1.jpg' which
    is in the RU subfolder 'dir1'

    thanks again,
    ...fn

  16. alanft
    Member
    Posted 4 years ago #

    Should the RU 0.13 folders be sub-folders of 'wp-content/uploads/'?

    Well WP would much rather that is the case -- and does assume that that is the case in a number of places in the code -- but I have been writing RU so that you shouldn't have to be constrained to this.

    thanks for all the info and for trying out variations. sadly i can't think what circumstances might be leading to the filter failing in your most recent of cases. I will try to think up some good debugging code you could add to the plugin to work out where it's tripping up.

  17. alanft
    Member
    Posted 4 years ago #

    !!! i think i see the problem - i have been amazingly lazy in the code and assumed the database prefix of wp_

    :-(

    if you look in the code at the function relocate_upload_library_filter you'll see a line that reads "AND wp_posts.guid LIKE"

    that wp_posts.guid should be replaced by $wpdb->posts.guid and the function needs an extra line at the start global $wpdb; to make that work.

    it would be amazing if you could tell me that fixes your problem. i'll be committing it to the 'dev' version asap anyway as it's an obvious mistake.

  18. fn1
    Member
    Posted 4 years ago #

    Alan,
    Apologies for the delay in getting back to you. Bingo!! Thank you so much! I confirm that Relocate Upload 0.13, with the corrections you indicated, is working for me on WP 2.8.
    Thank you again!

  19. alanft
    Member
    Posted 4 years ago #

    likewise, sorry to spot your follow up. i will commit the change asap

    i'll be updating some other bits and pieces -- some foolproofing code and some extra read-me stuff too

  20. mikii
    Member
    Posted 4 years ago #

    alanft, may I ask you if you have a release date for the new version of "relocate upload"? I am transferring a website and need to now if I can count on multiple directories or just have to put everything in the uploads folder.

    Also, I'd like to suggest a new feature: a "bulk action" to MOVE files from one folder to another would be much appreciated.

    Thanks for your attention.

    Mikii

  21. alanft
    Member
    Posted 4 years ago #

    i did commit the changes mentioned up thread at v0.14 (about a month ago) and that is the current stable version that should work ok.

    you are not the first person to suggest the bulk move option, but i just haven't found a good way to implement it yet. the GUI is there to do it, but i've not worked out how to plug in to it to do what i want.

  22. mikii
    Member
    Posted 4 years ago #

    alanft, thanks for pointing out 0.14 is the current version...
    I can't get it to work with multiple uploads though.
    It does not let me select the upload folder, just puts everything on the default one. Do you have any suggestions?

    Thanks.

  23. alanft
    Member
    Posted 4 years ago #

    it currently only works by moving items from the default location to your preferred locations. there is no bulk move option yet.

  24. mikii
    Member
    Posted 4 years ago #

    What I meant is that you can only UPLOAD one item a time to get it straight in the right folder.
    But if I understand your suggestion you are saying I can upload a bunch of pictures in the default folder and then move them via ftp to the desired subfolder? I'll try that.

    Thanks.

  25. alanft
    Member
    Posted 4 years ago #

    "move them via ftp to the desired subfolder"

    you will break those items in the media library if you do that.

    to keep the media library working ok, use the regular WP uploader. i guess you could temporarily change the upload folder if you want to upload lots to a specific folder. (though WP limits you to the wp-content folder)

    relocate upload won't do what you want.

  26. sisyphe
    Member
    Posted 4 years ago #

    Hi Alan,

    Thanks for sharing your plugin with the community. I'm very excited to use it, but at the risk of sounding like "it not work, fool", it doesn't seem to be functioning with the latest version of wordpress. I've installed and activated it and gone into settings to create paths to the directories I want to be able to access through the interface and that part works, but then nothing. There should be a new line in the media library or something, right? Am I missing something, or is it a compatibility issue?

    thanks!

  27. alanft
    Member
    Posted 4 years ago #

    i have to update the wording on the main page! the menu doesn't appear in the media library listing, but you should see a folder menu in the 'edit media' page when you click through to edit a specific item in the library, or in the 'insert into post' view too (which was what i really meant by 'media library' in the original description).

    i see it on my 2.8.5 install. did you have it working ok on 2.8.4 and this has just broken in 2.85?

  28. sisyphe
    Member
    Posted 4 years ago #

    Awesome. I now feel completely stupid for not having seen that drop down. You've done such a good job of integrating it with the WP backend. ;)

    I didn't test it in 2.8.4, so I'm afraid I can't tell you.

    Thanks again for the plugin. It's making a project I'm working on about ten billion times easier.

  29. karimun
    Member
    Posted 4 years ago #

    Hi Alan,
    I went through the posts and feel the only one who cannot delete his files after moving them to another folder. The database entries are gone but the file still remains.
    I also tried it with subfolders like /wp-content/subtest/ or /wp-content/uploads/subbtest/. Anyone else? Im with WP 2.8.2 and RU 0.14

  30. alanft
    Member
    Posted 4 years ago #

    I tried adding a file, moving it to a folder (/share from my www root folder) and then deleting the media library item, and it deleted it ok from the folder on the server.

    i haven't got a 2.8.2 to hand, but RU hasn't changed a lot with minor WP updates.

Topic Closed

This topic has been closed to new replies.

About this Topic