Fixed issue where cover images don't save on older books
Ensured an existing ID is always provided to image-picker.js. Fixes #773
This commit is contained in:
		
							parent
							
								
									cfdf5b93d9
								
							
						
					
					
						commit
						7f437c2e3c
					
				| 
						 | 
					@ -22,8 +22,8 @@
 | 
				
			||||||
            'resizeWidth' => '512',
 | 
					            'resizeWidth' => '512',
 | 
				
			||||||
            'showRemove' => false,
 | 
					            'showRemove' => false,
 | 
				
			||||||
            'defaultImage' => baseUrl('/book_default_cover.png'),
 | 
					            'defaultImage' => baseUrl('/book_default_cover.png'),
 | 
				
			||||||
            'currentImage' => @isset($model) ? $model->getBookCover() : baseUrl('/book_default_cover.png') ,
 | 
					            'currentImage' => isset($model) ? $model->getBookCover() : baseUrl('/book_default_cover.png') ,
 | 
				
			||||||
            'currentId' => @isset($model) ? $model->image_id : 0,
 | 
					            'currentId' => isset($model) && $model->image_id ? $model->image_id : 0,
 | 
				
			||||||
            'name' => 'image_id',
 | 
					            'name' => 'image_id',
 | 
				
			||||||
            'imageClass' => 'cover'
 | 
					            'imageClass' => 'cover'
 | 
				
			||||||
        ])
 | 
					        ])
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue