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

A fix for mime types handling #2362

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

wizardeur
Copy link
Contributor

Link to ticket

Problem described on Discord, see: https://discord.com/channels/990001288026677318/1212409774092718090/1212409774092718090)

Description

Adding a docx files to a todo works fine, but trying to download it results in 500 with the following information:

ErrorException:
Warning: Undefined array key "docx"

  at /var/www/html/app/Domain/Files/Controllers/Get.php:105
  at Leantime\Domain\Files\Controllers\Get->getFileLocally('eb3d6a81e7906c4c96c151b0929a26bd', 'docx', 'ticket', 'badania swialo niebieskie_2 (1)')
     (/var/www/html/app/Domain/Files/Controllers/Get.php:55)
  at Leantime\Domain\Files\Controllers\Get->get(array('module' => 'ticket', 'encName' => 'eb3d6a81e7906c4c96c151b0929a26bd', 'ext' => 'docx', 'realName' => 'badania swialo niebieskie_2 (1)', 'act' => 'files.get'))
     (/var/www/html/app/Core/Controller.php:82)
  at Leantime\Core\Controller->executeActions('GET', array('module' => 'ticket', 'encName' => 'eb3d6a81e7906c4c96c151b0929a26bd', 'ext' => 'docx', 'realName' => 'badania swialo niebieskie_2 (1)', 'act' => 'files.get'))
     (/var/www/html/app/Core/Controller.php:49)
  at Leantime\Core\Controller->__construct(object(IncomingRequest), object(Template), object(Language))
  at ReflectionClass->newInstanceArgs(array(object(IncomingRequest), object(Template), object(Language)))
     (/var/www/html/vendor/illuminate/container/Container.php:929)
  at Illuminate\Container\Container->build('Leantime\\Domain\\Files\\Controllers\\Get')
     (/var/www/html/vendor/illuminate/container/Container.php:770)
  at Illuminate\Container\Container->resolve('Leantime\\Domain\\Files\\Controllers\\Get', array())
     (/var/www/html/vendor/illuminate/container/Container.php:706)
  at Illuminate\Container\Container->make('Leantime\\Domain\\Files\\Controllers\\Get')
     (/var/www/html/app/Core/Frontcontroller.php:130)
  at Leantime\Core\Frontcontroller::executeAction('files.get', array())
     (/var/www/html/app/Core/Frontcontroller.php:75)
  at Leantime\Core\Frontcontroller::dispatch()
     (/var/www/html/app/Core/HttpKernel.php:63)
  at Leantime\Core\HttpKernel->Leantime\Core\{closure}(object(IncomingRequest))
     (/var/www/html/vendor/illuminate/pipeline/Pipeline.php:141)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(IncomingRequest))
     (/var/www/html/vendor/illuminate/pipeline/Pipeline.php:116)
  at Illuminate\Pipeline\Pipeline->then(object(Closure))
     (/var/www/html/app/Core/HttpKernel.php:63)
  at Leantime\Core\HttpKernel->Leantime\Core\{closure}(object(IncomingRequest))
     (/var/www/html/vendor/illuminate/pipeline/Pipeline.php:141)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(IncomingRequest))
     (/var/www/html/app/Core/Middleware/CurrentProject.php:25)
  at Leantime\Core\Middleware\CurrentProject->handle(object(IncomingRequest), object(Closure))
     (/var/www/html/vendor/illuminate/pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(IncomingRequest))
     (/var/www/html/app/Core/Middleware/Localization.php:48)
  at Leantime\Core\Middleware\Localization->handle(object(IncomingRequest), object(Closure))
     (/var/www/html/vendor/illuminate/pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(IncomingRequest))
     (/var/www/html/app/Core/Middleware/Auth.php:88)
  at Leantime\Core\Middleware\Auth->handle(object(IncomingRequest), object(Closure))
     (/var/www/html/vendor/illuminate/pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(IncomingRequest))
     (/var/www/html/app/Core/Middleware/Updated.php:37)
  at Leantime\Core\Middleware\Updated->handle(object(IncomingRequest), object(Closure))
     (/var/www/html/vendor/illuminate/pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(IncomingRequest))
     (/var/www/html/app/Core/Middleware/Installed.php:55)
  at Leantime\Core\Middleware\Installed->handle(object(IncomingRequest), object(Closure))
     (/var/www/html/vendor/illuminate/pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(IncomingRequest))
     (/var/www/html/app/Core/Middleware/InitialHeaders.php:22)
  at Leantime\Core\Middleware\InitialHeaders->handle(object(IncomingRequest), object(Closure))
     (/var/www/html/vendor/illuminate/pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(object(IncomingRequest))
     (/var/www/html/vendor/illuminate/pipeline/Pipeline.php:116)
  at Illuminate\Pipeline\Pipeline->then(object(Closure))
     (/var/www/html/app/Core/HttpKernel.php:64)
  at Leantime\Core\HttpKernel->handle(object(IncomingRequest))
     (/var/www/html/app/Core/Bootloader.php:303)
  at Leantime\Core\Bootloader->handleRequest()
     (/var/www/html/app/Core/Bootloader.php:173)
  at Leantime\Core\Bootloader->boot()
     (/var/www/html/public/index.php:18)  

This change fixes this.

@wizardeur wizardeur requested a review from a team as a code owner March 1, 2024 12:26
@wizardeur wizardeur requested review from broskees and removed request for a team March 1, 2024 12:26
@CLAassistant
Copy link

CLAassistant commented Mar 1, 2024

CLA assistant check
All committers have signed the CLA.

@marcelfolaron marcelfolaron merged commit 9329cb0 into Leantime:master Mar 1, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants