For some obscure reason, I get File renaming error! presented in red box next to the file name after pressing update in single media edit page and also when trying to bulk edit (I’ve checked the files on the left)
I use Basel theme and also WPML, Woocommerce etc.
The files are JPGs.
yesterday I found an error caused by versions 2.2.0 and 2.2.1 that only affects images renamed with that versions and only if you had the option “organize media file in subfolders” (I don’t remember the exact English name of the option).
If this is not the case, I fear that WPML had changed something, but they don’t support other plugin developers, so I can’t try it (I added WPML support some time ago installing it through another user licence).
I’m trying to replicate the issue both on my development and production environments, I’ll keep you informed.
Im facing same issue.
I was used before latest updated without any problem but newest version all time get “file renaming error” I dont have WPML and Woocommerce or specific plugin
I just downloaded your plugin for a client today and found the same error. In my particular instance I was trying to update a media item that was uploaded some time ago.
The issue is that the filepath is incorrect when trying to upload.
On line 501 of class-media-rename you use wp_upload_dir() to get the file pat array, then on line 514 use this array to return the path. However this returns the current path to uploads directory, which can change every month. Currently for me this is /wp-content/uploads/2020/09/ which is not the directory that the media item is in. Obviously this will work for items that have just been uploaded and renamed, but not for older items.
A fix I have found is to replace line 514 with
$filepath = str_replace(basename($filename), '', $filename);which gives the actual file_path.
You would have to update
$subfoldera well but I haven’t looked that far yet I’m afraid.
you’ve got the point!
Stupid me, that didn’t take in account the old subfolder structures, but I don’t use that WordPress option to help my SEO (this way I have shorter URLs for my medias).
I’ll fix it and release an update in a few hours.
version 2.2.4 is live with the fix proposed by @jockolad, everything seems working but let me know if you find other issues.
You have to thank @jockolad: he found the source of the issue 🙂
It is a pleasure to support my users!
I have version 2.2.4, but I get same problem today morning –> File renaming error!
What I have to do? WordPress version is newest. And I also use WPML.
- This reply was modified 1 year, 9 months ago by jhh78.
i published here http://eurosoftlab.com/lab/pmr.zip a new version that change the error message to help resolving the issue, can you manually install this new release and tell me which is the new error message?
I will release this new version for automatic update next week, feel free to wait if you
don’t feel comfortable with manual update.
- This reply was modified 1 year, 9 months ago by crossi72.
The new version shows the old and new filenames (something like “file renaming error! Tried to rename path/oldfilename.jpg in path/newfilename.jpg”) it still shows only “file renaming error!”?
- The topic ‘I get File renaming error! on single and bulk rename’ is closed to new replies.