Filenames and product codes are different animals. Product codes are entered into the db/table and can be validated immediately. Image filenames may also be entered, but AFAIK, wouldn't enter the table until after the file has already been uploaded. Validating the filename could have some logistic implications. But also, the filename may not be invalid to the OS. Bottom line, the filename problem really needs to fixed at the source.
Scott
					
					
					
				
			Announcement
				
					Collapse
				
			
		
	
		
			
				No announcement yet.
				
			
				
	
Shadows Imagemachine bug. -- Fails if image filename contains spaces.
				
					Collapse
				
			
		
	X
- 
	
		
		
		
		
		
	
	
	
	
It's not that people don't know, they simply forget or overlooked when copying and pasting data to save time. Image Machine, Product Code should have space and special character validation. It is a constant problem in-house and it creates a lot of problems and no easy fixes, its laborious and time consuming.Originally posted by lesliekirk View PostGood to know. I have tried for YEARS to get clients to not leave spaces in any file name but I can't seem to get through to all of them...Last edited by William Davis; 01-18-22, 01:50 PM.
Leave a comment:
 - 
	
		
		
		
		
		
	
	
	
	
Good to know. I have tried for YEARS to get clients to not leave spaces in any file name but I can't seem to get through to all of them...
Leave a comment:
 - 
	
		
		
		
		
		
	
	
	
	
Hi Ray,
Thanks for posting this. The issue will be addressed in the next Shadows release.
Leave a comment:
 - 
	
		
		
			
			
			
		
		
		
		
	
	
	
	
Shadows Imagemachine bug. -- Fails if image filename contains spaces.
FYI for anyone that encounters this.
In the following Part of the Shadows ImageMachine Head Template:
This failsCode:let InitializePhotoViewer = function (clickedImage) { if (images.length === 1) { PhotoViewerControls.classList.add('u-invisible'); } console.log(images.length); for (let i = 0; i < images.length; i++) { if (images[i].hasOwnProperty('imageSrc')) { if (clickedImage.includes(images[i].imageSrc)) { OpenPhotoViewer(images[i]); } } } };because clickedImage contains spaces encoded as "%20" and images[i].imageSrc contains spaces.Code:if (clickedImage.includes(images[i].imageSrc))
Fix:
Code:if ( decodeURI( clickedImage ).includes( decodeURI( images[i].imageSrc ) ) ) {Tags: None
 
Leave a comment: