MarkdownPlus icon indicating copy to clipboard operation
MarkdownPlus copied to clipboard

Comments don't work anymore

Open colonelpopcorn opened this issue 1 year ago • 4 comments

Instance info:

  • Application version: v1.2.36
  • PHP version: 8.3.6
  • PHP SAPI: fpm-fcgi
  • HTTP Client: cURL
  • OS version: Linux 6.1.0-0.deb11.11-amd64
  • Database driver: mysql
  • Database version: 10.11.7-MariaDB-1:10.11.7+maria~ubu2204
  • Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0

I tried adding a comment to one of my tasks, and after doing so all the styles were gone and I got an error in the logs of my instance:

2024/05/20 15:56:22 [error] 16#16: *3714 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to undefined method Kanboard\Plugin\MarkdownPlus\Helper\MarkdownPlusHelper::reply() in /var/www/app/app/Template/comment/show.php:65
Stack trace:
#0 /var/www/app/app/Core/Template.php(83): include()
#1 /var/www/app/app/Template/task_comments/show.php(15): Kanboard\Core\Template->render()
#2 /var/www/app/app/Core/Template.php(83): include('...')
#3 /var/www/app/app/Template/task/show.php(46): Kanboard\Core\Template->render()
#4 /var/www/app/app/Core/Template.php(83): include('...')
#5 /var/www/app/app/Helper/LayoutHelper.php(207): Kanboard\Core\Template->render()
#6 /var/www/app/app/Helper/LayoutHelper.php(74): Kanboard\Helper\LayoutHelper->subLayout()
#7 /var/www/app/app/Controller/TaskViewController.php(67): Kanboard\Helper\LayoutHelper->task()
#8 /var/www/app/app/Core/Controller/Runner.php(77): Kanboard\Controller\TaskViewController->show()
#9 /var/www/app/app/Core/Controller/Runner.php(31): Kanboard\Core\Controller\Runner->executeController()
#10 /var" while reading response header from upstream, client: 192.168.13.65, server: localhost, request: "GET /task/24 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "kanboard.<redacted-url>"

It seems that Kanboard added a function to render a reply-to line and that has not been added to markdown plus. Is there a way we could just extend the default text helper to safely fall through to default behavior in cases like this? Alternatively I can add the method in to my local instance and see if that fixes it.

colonelpopcorn avatar May 20 '24 16:05 colonelpopcorn

Adding these lines here to the MarkdownPlusHelper.php file solved the issue for me. I do want to try extending the TextHelper, as well. If that works I'll put up a PR with that solution since it's more future proof.

colonelpopcorn avatar May 20 '24 16:05 colonelpopcorn

Extending the TextHelper works. We could probably save a lot of headache by just using that. Then we don't have to implement every part of the text helper again, just the parts we want to override.

colonelpopcorn avatar May 20 '24 16:05 colonelpopcorn

Make a PR if you got it.

creecros avatar May 20 '24 19:05 creecros

#26 addresses this issue.

colonelpopcorn avatar May 20 '24 20:05 colonelpopcorn

Latest merges address this issue. Next release will close this issue.

colonelpopcorn avatar Jun 18 '24 17:06 colonelpopcorn