Skip to content
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

[4.3] Media Manager error message #314

Closed
joomlapl-bot opened this issue Feb 19, 2023 · 0 comments
Closed

[4.3] Media Manager error message #314

joomlapl-bot opened this issue Feb 19, 2023 · 0 comments

Comments

@joomlapl-bot
Copy link
Collaborator

PR w związku ze zmianą oryginału joomla/joomla-cms#39741 Poniżej zmiany w oryginale:

Click to expand the diff!
diff --git a/administrator/components/com_media/src/Controller/ApiController.php b/administrator/components/com_media/src/Controller/ApiController.php
index 46497ab5a426..cf5362d68bae 100644
--- a/administrator/components/com_media/src/Controller/ApiController.php
+++ b/administrator/components/com_media/src/Controller/ApiController.php
@@ -12,10 +12,12 @@
 
 use Joomla\CMS\Component\ComponentHelper;
 use Joomla\CMS\Helper\MediaHelper;
+use Joomla\CMS\HTML\HTMLHelper;
 use Joomla\CMS\Language\Text;
 use Joomla\CMS\MVC\Controller\BaseController;
 use Joomla\CMS\MVC\Model\BaseModel;
 use Joomla\CMS\Response\JsonResponse;
+use Joomla\CMS\Router\Route;
 use Joomla\CMS\Session\Session;
 use Joomla\Component\Media\Administrator\Exception\FileExistsException;
 use Joomla\Component\Media\Administrator\Exception\FileNotFoundException;
@@ -355,7 +357,9 @@ private function checkContent()
             || ($postMaxSize > 0 && $contentLength > $postMaxSize)
             || ($memoryLimit > -1 && $contentLength > $memoryLimit)
         ) {
-            throw new \Exception(Text::_('COM_MEDIA_ERROR_WARNFILETOOLARGE'), 403);
+            $link   = 'index.php?option=com_config&view=component&component=com_media';
+            $output = HTMLHelper::_('link', Route::_($link), Text::_('JOPTIONS'));
+            throw new \Exception(Text::sprintf('COM_MEDIA_ERROR_WARNFILETOOLARGE', $output), 403);
         }
     }
 
diff --git a/administrator/language/en-GB/com_media.ini b/administrator/language/en-GB/com_media.ini
index ccc19dde3b7d..61ae6cb41001 100644
--- a/administrator/language/en-GB/com_media.ini
+++ b/administrator/language/en-GB/com_media.ini
@@ -37,7 +37,7 @@ COM_MEDIA_ERROR_NOT_FOUND="File or Folder not found"
 COM_MEDIA_ERROR_NO_ADAPTER_FOUND="No adapter found."
 COM_MEDIA_ERROR_NO_CONTENT_AVAILABLE="No content available!"
 COM_MEDIA_ERROR_NO_PROVIDERS="No filesystem providers have been found. Please enable at least one <a href=\"%s\">filesystem plugin</a>."
-COM_MEDIA_ERROR_WARNFILETOOLARGE="This file is too large to upload. You can change the limits for your site in the component options."
+COM_MEDIA_ERROR_WARNFILETOOLARGE="This file is too large to upload. You can change the limits for your site in the Media component %s."
 COM_MEDIA_FIELDSET_OPTIONS_LABEL="Media"
 COM_MEDIA_FIELD_CHECK_MIME_DESC="Use MIME Magic or Fileinfo to attempt to verify files. Try disabling this if you get invalid mime type errors."
 COM_MEDIA_FIELD_CHECK_MIME_LABEL="Check MIME Types"
zwiastunsw added a commit that referenced this issue May 21, 2023
fix #286
fix #287
fix #288
fix #291
fix #292
fix #295
fix #296
fix #297
fix #298
fix #299
fix #300
fix #305
fix #308
fix #309
fix #310
fix #313
fix #314
fix #321
fix #322
fix #323
fix #324
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants