Nechalon
03/21/2023, 12:56 PMmedias field which holds an image, and everytime I try to save the new picture, it fails with this error Your submission could not be validated, please fix and retry. I tried setting up the $mediasParams array correctly, but it seems like it has no effect. I believe that the model is setup correctly because it saves the title when the image field is not there to throw an error.
What else do I need to setup to save the selectd image?ifox
03/21/2023, 12:57 PMNechalon
03/21/2023, 12:58 PMpublic $mediasParams = [
'background_desktop' => [
'desktop' => [
[
'name' => 'desktop',
'ratio' => 0,
],
],
'mobile' => [
[
'name' => 'mobile',
'ratio' => 4/3,
],
]
],
];
background_desktop and thats the same for the medias here
@formField('medias', [
'name' => 'background_desktop',
'label' => __('form.newsletter_background_desktop'),
])ifox
03/21/2023, 1:00 PMNechalon
03/21/2023, 1:01 PMkalle
03/21/2023, 1:01 PMNechalon
03/21/2023, 1:01 PMNechalon
03/21/2023, 1:05 PMThe given data was invalid. error message and shows failedValidation function. Is it possible that it fails because of the [Module]Request.php?Nechalon
03/21/2023, 1:07 PMifox
03/21/2023, 1:09 PMNechalon
03/21/2023, 1:10 PMNechalon
03/21/2023, 1:21 PMifox
03/21/2023, 1:27 PM$item->image('background_desktop', 'desktop') would render itNechalon
03/21/2023, 2:36 PMdesktop and one named mobile, none of them are shown.
ratio array key does work because it changes the aspect ratio of the picture.ifox
03/21/2023, 2:58 PMNechalon
03/21/2023, 3:02 PMifox
03/21/2023, 3:41 PMNechalon
03/21/2023, 7:01 PMNechalon
03/22/2023, 10:51 AMifox
03/22/2023, 10:56 AMNechalon
03/22/2023, 11:07 AMifox
03/22/2023, 11:15 AMifox
03/22/2023, 11:16 AMifox
03/22/2023, 11:16 AMNechalon
03/22/2023, 11:21 AMNechalon
03/22/2023, 11:26 AMifox
03/22/2023, 11:27 AMNechalon
03/22/2023, 11:29 AMifox
03/22/2023, 11:30 AM