[Bug] language selector "all" is cleared when wrong media format is uploaded

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
rowild

[Bug] language selector "all" is cleared when wrong media format is uploaded

Post by rowild » 06 Mar 2023, 08:55

I have a product with a meta description text. The language of that text is set to "All" (like in the demo data that comes with Aimeos).

When I upload a mp3-file to the media section – a file format that seems not be be allowed (why??) – an (not very descriptive) error is shown in the notification that pops up. There is no indication as to where this error happens or why.

Clicking "save" for a 2nd time reveals that the error seems to be with the meta description text, where the selected language was reset to "Please select".

From this point on every editing is lost, because a simple removal of the problematic data does not fix the "save" problem, the erro keeps popping up, even though there is not audio file anymore and the language is set to "all" again.

I uploaded a short video about my workflow here:
https://dl.rowild.at/aimeos-media-upload-problem.mp4

I would expect
1. a better and correct error message (because the problem seems to be that mp3 is not an accepted file format; this should be the error message)
2. that audio files are allowed (video files are, so why not audio files?)
3. that removing the file fixes the error and allows saving again

Env.:
-------
Typo3 11.5
Aimeos 22.10
php8.1

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: [Bug] language selector "all" is cleared when wrong media format is uploaded

Post by aimeos » 08 Mar 2023, 08:09

rowild wrote: 06 Mar 2023, 08:55 When I upload a mp3-file to the media section – a file format that seems not be be allowed (why??) – an (not very descriptive) error is shown in the notification that pops up. There is no indication as to where this error happens or why.
There's a list of accepted mime types for security reasons which you can extend by your own file types:
https://github.com/aimeos/aimeos-core/b ... #L574-L615

The error message is very general because it's not an exception that is marked as "save" at the moment. Therefore, it's only logged and you can see it in the log panel of the admin backend. We want to move the media controller code to the media manager and then, the error message will be better.
rowild wrote: 06 Mar 2023, 08:55 Clicking "save" for a 2nd time reveals that the error seems to be with the meta description text, where the selected language was reset to "Please select".
The language seems to be lost on errors. Can you please check if it's lost in the template or in the class:
- https://github.com/aimeos/ai-admin-jqad ... #L145-L162
- https://github.com/aimeos/ai-admin-jqad ... d.php#L263
- https://github.com/aimeos/ai-admin-jqad ... #L119-L147
- https://github.com/aimeos/ai-admin-jqad ... p#L81-L102
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

rowild

Re: [Bug] language selector "all" is cleared when wrong media format is uploaded

Post by rowild » 08 Mar 2023, 11:31

Please have a look in my other post auf audio files upload, where I address more problems. I cannot do what you ask me to here, until those problems are addressed.

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: [Bug] language selector "all" is cleared when wrong media format is uploaded

Post by aimeos » 08 Mar 2023, 12:09

Tried at the Aimeos admin demo https://admin.demo.aimeos.org/ but were unable to reproduce the issue seen in your video ...
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

rowild

Re: [Bug] language selector "all" is cleared when wrong media format is uploaded

Post by rowild » 08 Mar 2023, 12:51

Did you use an audio file? I can reproduce the issue in the Admin Demo.

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: [Bug] language selector "all" is cleared when wrong media format is uploaded

Post by aimeos » 10 Mar 2023, 09:07

Yes, used and MP3 file but the language of the text is still "All" after the content is saved and the error message displayed. Can you please make a video while demonstrating at https://admin.demo.aimeos.org/?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

rowild

Re: [Bug] language selector "all" is cleared when wrong media format is uploaded

Post by rowild » 10 Mar 2023, 09:54

You are right, the "All" lang does not change in the Laravel demo. (But the audio file can still not be uploaded.)
However, it does get lost in my composer-installed TYPO3 instance on all-inkl , and I made another video to demonstrate that:

https://dl.rowild.at/aimeos-typo3-upload-probem.mp4

However, this problem disappears as soon as the audio mimetypes will be implemented. (I think you just merged that PR.) So most likely this problem will disappear.

Sode note: With audio mimetypes implemented and no audio player feature, the upload will show an "unknown-filetype" icon when uploading an audio file. It would be nice to have at least icons that show the format/file ending. But I don't find the icons anywhere in the aimeos eco system. (There will be an "application-pdf.png", when uploading a pdf, but event that icon is nowhere to find in any of the aimeos extensions. ???)

Post Reply