When a Media item's file is changed (by replacing the file with another, and saving) - the client is using the SeoChecker package to automatically create a redirect of the old media URL to the new media URL - so that old URLs that have been shared with others still work and point to the latest version. This works on a single environment, but when we push the change via uSync (complete) only the media item is updated and the redirect doesn't get re-applied on the new server. I saw in previous versions a call to the MediaService.Save for the item being sent, which I think would trigger the SeoChecker's logic. However, it does not seem to be triggering in this uSync version for umbraco v8 (or maybe it is and it just doesn't work to recreate redirects?).
Is there a way to either A) trigger MediaService.Save for the updated media item, so that the redirect logic can be triggered and a redirect can be added, or B) use uSync to send the SeoChecker entries from one environment to the other when a linked media item is changed and pushed up?
I might have to take a look into this, I am not sure what triggers SEO to add the redirect, but in theory the uSync sync will update the existing media item, so it should trigger all save events, that i (suspect) are where SEO checker listens and adds its redirect.
Adding something to sync SEOChecker entries between environments is also something we could look at - an extension to uSync should be able to sync them - but if the first way works it would be a bit better as it would be automatic and you wouldn't be syncing any redirects you might not need.
Update: this is now working as expected. I needed to turn on the "Redirect when node exists" option in General Settings in the SEO Checker. Updating the media (replacing the file with a new version of the file) the first time after a v7 to v8 upgrade changes the number value in /media/{number}/{filename}.{fileextension} URL in v8 from an integer to a unique alpha-numeric value. SEO Checker properly creates a redirect for the old path to a new. Using Push To Server on the media sends the change to the next environment. The SEO Checker on that environment also creates the Media Redirect there - as desired. The reason this wasn't working before is because when I previously would "Push to Environment", uSync doesn't automatically delete the old media file on the new environment that was associated with the updated media item. (The file would have gotten removed if I had used the uSync dashboard and had the "Remove deleted items" AND "Media / files" options checked for the uSync Push settings). Since I previously didnt have the "Redirect when node exists" option enabled, it wouldn't work on the target environment until I deleted the old media item (or enabled the setting).
Hoping the details help somebody else out. Thanks Kevin for being so responsive and confirming that you also believed this should work in theory with uSync.
uSync and SeoChecker Redirects for Media
When a Media item's file is changed (by replacing the file with another, and saving) - the client is using the SeoChecker package to automatically create a redirect of the old media URL to the new media URL - so that old URLs that have been shared with others still work and point to the latest version. This works on a single environment, but when we push the change via uSync (complete) only the media item is updated and the redirect doesn't get re-applied on the new server. I saw in previous versions a call to the MediaService.Save for the item being sent, which I think would trigger the SeoChecker's logic. However, it does not seem to be triggering in this uSync version for umbraco v8 (or maybe it is and it just doesn't work to recreate redirects?).
Is there a way to either A) trigger MediaService.Save for the updated media item, so that the redirect logic can be triggered and a redirect can be added, or B) use uSync to send the SeoChecker entries from one environment to the other when a linked media item is changed and pushed up?
Hi,
I might have to take a look into this, I am not sure what triggers SEO to add the redirect, but in theory the uSync sync will update the existing media item, so it should trigger all save events, that i (suspect) are where SEO checker listens and adds its redirect.
Adding something to sync SEOChecker entries between environments is also something we could look at - an extension to uSync should be able to sync them - but if the first way works it would be a bit better as it would be automatic and you wouldn't be syncing any redirects you might not need.
Thank you Kevin! I'm very interested in your findings
Update: this is now working as expected. I needed to turn on the "Redirect when node exists" option in General Settings in the SEO Checker. Updating the media (replacing the file with a new version of the file) the first time after a v7 to v8 upgrade changes the number value in /media/{number}/{filename}.{fileextension} URL in v8 from an integer to a unique alpha-numeric value. SEO Checker properly creates a redirect for the old path to a new. Using Push To Server on the media sends the change to the next environment. The SEO Checker on that environment also creates the Media Redirect there - as desired. The reason this wasn't working before is because when I previously would "Push to Environment", uSync doesn't automatically delete the old media file on the new environment that was associated with the updated media item. (The file would have gotten removed if I had used the uSync dashboard and had the "Remove deleted items" AND "Media / files" options checked for the uSync Push settings). Since I previously didnt have the "Redirect when node exists" option enabled, it wouldn't work on the target environment until I deleted the old media item (or enabled the setting).
Hoping the details help somebody else out. Thanks Kevin for being so responsive and confirming that you also believed this should work in theory with uSync.
Sorry was on holiday but great it's working now :-)
is working on a reply...