nextcloud / nextcloud/files_mindmap

Cannot preview my Mind Map in the share page.

Open
#125 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
197
Forks
52
Avg merge
22h 14m
Merged PRs (30d)
13

Description

{"reqId":"DIExGX3HEJxco4LpziXZ","level":3,"time":"2020-07-14T04:11:59+00:00","remoteAddr":"121.225.146.123","user":"--","app":"index","method":"GET","url":"/collaboration/index.php/s/BNBcbz26PcB97my","message":{"Exception":"TypeError","Message":"substr() expects parameter 3 to be integer, boolean given","Code":0,"Trace":[{"file":"/var/www/html/collaboration/lib/private/Files/Type/Detection.php","line":377,"function":"substr","args":["mindmap",0,false]},{"file":"/var/www/html/collaboration/apps/files_sharing/templates/public.php","line":22,"function":"mimeTypeIcon","class":"OC\Files\Type\Detection","type":"->","args":["mindmap"]},{"file":"/var/www/html/collaboration/lib/private/Template/Base.php","line":179,"args":["/var/www/html/collaboration/apps/files_sharing/templates/public.php"],"function":"include"},{"file":"/var/www/html/collaboration/lib/private/Template/Base.php","line":151,"function":"load","class":"OC\Template\Base","type":"->","args":["/var/www/html/collaboration/apps/files_sharing/templates/public.php",{"displayName":"admin","owner":"admin","filename":"知识库统计.km","directory_path":"/知识库统计.km","note":"","mimetype":"application/km","previewSupported":false,"dirToken":"BNBcbz26PcB97my","sharingToken":"BNBcbz26PcB97my","server2serversharing":true,"protected":"false","dir":"","nonHumanFileSize":13447,"fileSize":"13 KB","hideDownload":false,"showgridview":false,"hideFileList":false,"shareOwner":"admin","downloadURL":"http://www.amazehome.xyz/collaboration/index.php/s/BNBcbz26PcB97my/download","shareUrl":"http://www.amazehome.xyz/collaboration/index.php/s/BNBcbz26PcB97my","maxSizeAnimateGif":10,"previewEnabled":true,"previewMaxX":1024,"previewMaxY":1024,"disclaimer":null,"previewURL":"http://www.amazehome.xyz/collaboration/index.php/s/BNBcbz26PcB97my/download","previewImage":"http://www.amazehome.xyz/collaboration/core/img/favicon-fb.png","template":{"class":"OCP\AppFramework\Http\Template\PublicTemplateResponse"}}]},{"file":"/var/www/html/collaboration/lib/private/legacy/template.php","line":181,"function":"fetchPage","class":"OC\Template\Base","type":"->","args":[{"displayName":"admin","owner":"admin","filename":"知识库统计.km","directory_path":"/知识库统计.km","note":"","mimetype":"application/km","previewSupported":false,"dirToken":"BNBcbz26PcB97my","sharingToken":"BNBcbz26PcB97my","server2serversharing":true,"protected":"false","dir":"","nonHumanFileSize":13447,"fileSize":"13 KB","hideDownload":false,"showgridview":false,"hideFileList":false,"shareOwner":"admin","downloadURL":"http://www.amazehome.xyz/collaboration/index.php/s/BNBcbz26PcB97my/download","shareUrl":"http://www.amazehome.xyz/collaboration/index.php/s/BNBcbz26PcB97my","maxSizeAnimateGif":10,"previewEnabled":true,"previewMaxX":1024,"previewMaxY":1024,"disclaimer":null,"previewURL":"http://www.amazehome.xyz/collaboration/index.php/s/BNBcbz26PcB97my/download","previewImage":"http://www.amazehome.xyz/collaboration/core/img/favicon-fb.png","template":{"class":"OCP\AppFramework\Http\Template\PublicTemplateResponse"}}]},{"file":"/var/www/html/collaboration/lib/public/AppFramework/Http/TemplateResponse.php","line":167,"function":"fetchPage","class":"OC_Template","type":"->","args":[{"displayName":"admin","owner":"admin","filename":"知识库统计.km","directory_path":"/知识库统计.km","note":"","mimetype":"application/km","previewSupported":false,"dirToken":"BNBcbz26PcB97my","sharingToken":"BNBcbz26PcB97my","server2serversharing":true,"protected":"false","dir":"","nonHumanFileSize":13447,"fileSize":"13 KB","hideDownload":false,"showgridview":false,"hideFileList":false,"shareOwner":"admin","downloadURL":"http://www.amazehome.xyz/collaboration/index.php/s/BNBcbz26PcB97my/download","shareUrl":"http://www.amazehome.xyz/collaboration/index.php/s/BNBcbz26PcB97my","maxSizeAnimateGif":10,"previewEnabled":true,"previewMaxX":1024,"previewMaxY":1024,"disclaimer":null,"previewURL":"http://www.amazehome.xyz/collaboration/index.php/s/BNBcbz26PcB97my/download","previewImage":"http://www.amazehome.xyz/collaboration/core/img/favicon-fb.png","template":{"class":"OCP\AppFramework\Http\Template\PublicTemplateResponse"}}]},{"file":"/var/www/html/collaboration/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php","line":156,"function":"render","class":"OCP\AppFramework\Http\TemplateResponse","type":"->","args":[]},{"file":"/var/www/html/collaboration/lib/private/AppFramework/Http/Dispatcher.php","line":123,"function":"render","class":"OCP\AppFramework\Http\Template\PublicTemplateResponse","type":"->","args":[]},{"file":"/var/www/html/collaboration/lib/private/AppFramework/App.php","line":125,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[{"class":"OCA\Files_Sharing\Controller\ShareController"},"showShare"]},{"file":"/var/www/html/collaboration/lib/private/AppFramework/Routing/RouteActionHandler.php","line":47,"function":"main","class":"OC\AppFramework\App","type":"::","args":["OCA\Files_Sharing\Controller\ShareController","showShare",{"class":"OC\AppFramework\DependencyInjection\DIContainer"},{"token":"BNBcbz26PcB97my","_route":"files_sharing.sharecontroller.showShare"}]},{"function":"__invoke","class":"OC\AppFramework\Routing\RouteActionHandler","type":"->","args":[{"token":"BNBcbz26PcB97my","_route":"files_sharing.sharecontroller.showShare"}]},{"file":"/var/www/html/collaboration/lib/private/Route/Router.php","line":299,"function":"call_user_func","args":[{"class":"OC\AppFramework\Routing\RouteActionHandler"},{"token":"BNBcbz26PcB97my","_route":"files_sharing.sharecontroller.showShare"}]},{"file":"/var/www/html/collaboration/lib/base.php","line":1008,"function":"match","class":"OC\Route\Router","type":"->","args":["/s/BNBcbz26PcB97my"]},{"file":"/var/www/html/collaboration/index.php","line":38,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/collaboration/lib/private/Files/Type/Detection.php","Line":377,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36","version":"18.0.6.0","id":"5f0d30ac9be2b"}

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lib/private/Files/Type/Detection.php at line 377 and follow its use from apps/files_sharing/templates/public.php line 22 through the files_sharing.sharecontroller.showShare route. Reproduce the public share page with the reported mind map file and inspect why the mimeTypeIcon call reaches substr() with a boolean length. Done means the share page renders without this TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.