adrian Posted October 22, 2018 Author Posted October 22, 2018 @simonsays Just back online tonight - will take a look tomorrow.
simonsays Posted November 22, 2018 Posted November 22, 2018 On 10/22/2018 at 1:32 PM, adrian said: @simonsays Just back online tonight - will take a look tomorrow. Hello ?
adrian Posted November 23, 2018 Author Posted November 23, 2018 On 11/22/2018 at 2:37 AM, simonsays said: Hello ? Sorry, I haven't forgotten - just had other priorities get in the way - I'll try to take a look soon.
PWaddict Posted November 23, 2018 Posted November 23, 2018 @adrian Checking "Rename on Save" and inserting the image link inside textarea field via "Insert Link" and then "Select File" and finally saving the page it doesn't update the link. It always lead to the previous filename. Can you please fix it? 1
adrian Posted November 24, 2018 Author Posted November 24, 2018 4 hours ago, PWaddict said: @adrian Checking "Rename on Save" and inserting the image link inside textarea field via "Insert Link" and then "Select File" and finally saving the page it doesn't update the link. It always lead to the previous filename. Can you please fix it? Any chance you are inserting into a multi-language textarea field? If so, then it should be fixed in the latest version. If not, please let me know and I can investigate further.
PWaddict Posted November 24, 2018 Posted November 24, 2018 40 minutes ago, adrian said: Any chance you are inserting into a multi-language textarea field? If so, then it should be fixed in the latest version. If not, please let me know and I can investigate further. I was testing it in a NON multi-language textarea field.
adrian Posted November 24, 2018 Author Posted November 24, 2018 11 minutes ago, PWaddict said: I was testing it in a NON multi-language textarea field. Are you in a repeater or anything else unusual?
PWaddict Posted November 24, 2018 Posted November 24, 2018 53 minutes ago, adrian said: Any chance you are inserting into a multi-language textarea field? If so, then it should be fixed in the latest version. I just tried it on a multi-language textarea field with the latest version (1.0.11) and it has the same problem. 5 minutes ago, adrian said: Are you in a repeater or anything else unusual? Nope
PWaddict Posted November 24, 2018 Posted November 24, 2018 If I understand correctly you've updated the part of the module that searches img tags inside textarea. The problem I'm having has nothing to do with img tags cause I do NOT add the images inside textarea. I only add their LINKS via "Insert Link" and then "Select File". 1
adrian Posted November 24, 2018 Author Posted November 24, 2018 2 minutes ago, PWaddict said: I only add their LINKS via "Insert Link" and then "Select File". Oh sorry, I missed that distinction. I'll see what I can do about supporting that situation. 1
adrian Posted November 24, 2018 Author Posted November 24, 2018 @PWaddict - it should now work in the latest version. @simonsays - I think all your repeater issues should also now be fixed - sorry again for the huge delay on this. 2
PWaddict Posted November 24, 2018 Posted November 24, 2018 13 minutes ago, adrian said: it should now work in the latest version. Yep although adding image links on a textarea field that belongs to another page it doesn't update them. 1
adrian Posted November 24, 2018 Author Posted November 24, 2018 12 hours ago, PWaddict said: Yep although adding image links on a textarea field that belongs to another page it doesn't update them. Good point. I am attaching a new version here for you to test. I don't have much time this morning to test it properly, but hopefully this will also handle that. @simonsays - could also please test this version? ProcessCustomUploadNames.zip 2
PWaddict Posted November 24, 2018 Posted November 24, 2018 1 hour ago, adrian said: I am attaching a new version here for you to test. It's almost perfect. There is only 1 small issue: Assuming that you have 2 tabs open in your browser. The 1st tab has the page where you renaming the image and the 2nd tab has the page with the textarea field where you inserting the image link. If I save the page on the 1st tab and then save the page on the 2nd tab without refreshing it then the old link will be saved and it will never gets updated again until I manually go and select the link via "Insert Link > Select File".
adrian Posted November 24, 2018 Author Posted November 24, 2018 4 minutes ago, PWaddict said: It's almost perfect. There is only 1 small issue: Assuming that you have 2 tabs open in your browser. The 1st tab has the page where you renaming the image and the 2nd tab has the page with the textarea field where you inserting the image link. If I save the page on the 1st tab and then save the page on the 2nd tab without refreshing it then the old link will be saved and it will never gets updated again until I manually go and select the link via "Insert Link > Select File". Not really sure that could be dealt with without maintaining a database of filename changes and associated page ids and checking against them whenever a page is changed. If you have a simple approach I am not thinking of, I'd be happy to implement.
PWaddict Posted November 24, 2018 Posted November 24, 2018 3 hours ago, adrian said: Not really sure that could be dealt with without maintaining a database of filename changes and associated page ids and checking against them whenever a page is changed. If you have a simple approach I am not thinking of, I'd be happy to implement. I've temporarily disabled the rule just to test with PW core function on image linking and it doesn't update image links even if the image and the textarea are on the same page. EDIT: Should I open issue on GitHub?
PWaddict Posted November 24, 2018 Posted November 24, 2018 5 hours ago, adrian said: ProcessCustomUploadNames.zip On this version if the image and the textarea are on the same page the image links are not updated. On the 1.0.13 it works ok.
adrian Posted November 24, 2018 Author Posted November 24, 2018 41 minutes ago, PWaddict said: On this version if the image and the textarea are on the same page the image links are not updated. On the 1.0.13 it works ok. Strange - it seems to be working here. Is there something in your setup that differs from this?
PWaddict Posted November 24, 2018 Posted November 24, 2018 45 minutes ago, adrian said: Strange - it seems to be working here. Is there something in your setup that differs from this? No. I reinstalled the unreleased version again and it's working now but I've noticed that it doesn't always rename the filename when I save the page. On Filename format I'm using this $page->title-[Y-m-d_H-i-s] so I would know if image is renamed. Keep saving the page again and again and you'll notice the issue.
PWaddict Posted November 25, 2018 Posted November 25, 2018 @adrian If I use this: [Y-m-d_H-i-s]-$page->title the filename ALWAYS renamed on save but if I use this $page->title-[Y-m-d_H-i-s] or this [Y-m-d_H-i-s] it doesn't. 1
adrian Posted November 25, 2018 Author Posted November 25, 2018 1 minute ago, PWaddict said: @adrian If I use this: [Y-m-d_H-i-s]-$page->title the filename ALWAYS renamed on save but if I use this $page->title-[Y-m-d_H-i-s] or this [Y-m-d_H-i-s] it doesn't. Thanks for the debugging. That actually makes sense because I have a check to not rename files with "-n" extensions because PW's automatic adding of "-n" when there is already a file of the same name. I'll have to see if I can sort out a workaround for this, but I won't be able to look until tomorrow. 1
PWaddict Posted November 25, 2018 Posted November 25, 2018 23 minutes ago, adrian said: Thanks for the debugging. That actually makes sense because I have a check to not rename files with "-n" extensions because PW's automatic adding of "-n" when there is already a file of the same name. I'll have to see if I can sort out a workaround for this, but I won't be able to look until tomorrow. Maybe you should allow the date format [Y-m-d_H-i-s] & $file->mtime starting with underscore "_" instead of dash "-".
adrian Posted November 27, 2018 Author Posted November 27, 2018 On 11/25/2018 at 9:40 AM, PWaddict said: Maybe you should allow the date format [Y-m-d_H-i-s] & $file->mtime starting with underscore "_" instead of dash "-". You should be able to specify any PHP date() format you want - if you want to replace those dashes with underscores you can. I think that should take care of the conflict with the "-n" suffix check.
PWaddict Posted November 27, 2018 Posted November 27, 2018 36 minutes ago, adrian said: You should be able to specify any PHP date() format you want - if you want to replace those dashes with underscores you can. I think that should take care of the conflict with the "-n" suffix check. A dot must be used between fields to work properly and yes about the php date underscores inside the brackets is the solution: $page->title.[Y_m_d_H_i_s] $page->title.$file->mtime Don't forget to update the module with the proper version you posted above and also add the above examples in Rename Rules description. THANKS A LOT ?
adrian Posted November 27, 2018 Author Posted November 27, 2018 1 minute ago, PWaddict said: A dot must be used between fields to work properly I use curly braces, like this: {$page->title}-[Y_m_d_H_i_s] 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now