Skip to content

BUGFIX: MediaBrowser's upload action shows empty flash message if file is too big #5553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 8.3
Choose a base branch
from

Conversation

mhsdesign
Copy link
Member

@mhsdesign mhsdesign commented May 3, 2025

expected (like in the standalone media browser)

image

actual (media browser insider neos ui):

image

interestingly the error works in the neos ui when one uses the media browsers drag and drop

image

The existence of this bug was uncovered via #5528 because previously no validation error was shown and on upload the server just died:

image

Could not convert target type "Neos\Media\Domain\Model\Asset": Missing constructor argument "resource" for object of type "Neos\Media\Domain\Model\Asset".

Upgrade instructions

Review instructions

This bug was uncovered because translate() simply returns undefined, if not initialised. No error no fallback, nuthing.
Also while I18n.init() IS called, it doesnt actually initialise anything. For that

cachedFetch(Configuration.get("XliffUri")).then((xliffData) => {
if (xliffData) {
Localization.initTranslations(xliffData);
}
});

has to be invoked and that is done by adding the link.


Notice also that ist not particularly keen of us to initialise I18n once in the host (neos.ui) and then in the iframe too. This is just extra work for the browser, and we dump the iframe after selecting the image.
Now my pr doenst improve that but there are ideas outlined here neos/neos-ui#3119 and the first step for a global translate api was already introduced via neos/neos-ui#3804.
Nothing for a bugfix to build up on though.

Checklist

  • Code follows the PSR-2 coding style
  • Tests have been created, run and adjusted as needed
  • The PR is created against the lowest maintained branch
  • Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • Reviewer - The first section explains the change briefly for change-logs
  • Reviewer - Breaking Changes are marked with !!! and have upgrade-instructions

…dered outside Neos module

This bug was uncovered because translate() simply returns undefined, if not initialised. No error no fallback, nuthing.
@mhsdesign mhsdesign force-pushed the bugfix/mediabrowser-upload-action-file-too-big-message-is-empty branch from 4086be3 to 9c4f0d8 Compare May 20, 2025 07:08
@mhsdesign mhsdesign marked this pull request as ready for review May 20, 2025 07:13
Copy link
Member

@nezaniel nezaniel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@mhsdesign mhsdesign requested a review from kitsunet May 22, 2025 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants