greyaz / ThemeRevision

A task-first and high-quality theme for Kanboard. It's also aimed at better mobile experiences, common plugin compatibilities, and customization friendly.
MIT License
53 stars 9 forks source link

Error when installing 1.0.2 as documented #2

Closed jlkDE closed 2 years ago

jlkDE commented 2 years ago

After cloning the repository and checking out 1.0.2 an error is thrown instead of showing anything from Kanboard anymore. This does happen for every site and route:

Fatal error: Uncaught Error: Undefined constant "Kanboard\Plugin\ThemeRevision\Helper\colorModel" in /var/www/app/plugins/ThemeRevision/Helper/ColorSwitchHelper.php:23 Stack trace: #0 /var/www/app/plugins/ThemeRevision/Helper/ColorSwitchHelper.php(45): Kanboard\Plugin\ThemeRevision\Helper\ColorSwitchHelper->setColor2Light() #1 /var/www/app/plugins/ThemeRevision/Plugin.php(61): Kanboard\Plugin\ThemeRevision\Helper\ColorSwitchHelper->setUserColor() #2 /var/www/app/vendor/symfony/event-dispatcher/EventDispatcher.php(264): Kanboard\Plugin\ThemeRevision\Plugin->onStartup() #3 /var/www/app/vendor/symfony/event-dispatcher/EventDispatcher.php(239): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch() #4 /var/www/app/vendor/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners() #5 /var/www/app/app/Middleware/BootstrapMiddleware.php(21): Symfony\Component\EventDispatcher\EventDispatcher->dispatch() #6 /var/www/app/app/Core/Controller/Runner.php(62): Kanboard\Middleware\BootstrapMiddleware->execute() #7 /var/www/app/app/Core/Controller/Runner.php(28): Kanboard\Core\Controller\Runner->executeMiddleware() #8 /var/www/app/index.php(9): Kanboard\Core\Controller\Runner->execute() #9 {main} thrown in /var/www/app/plugins/ThemeRevision/Helper/ColorSwitchHelper.php on line 23

Interestingly 1.0.0 throws a different but similar error:


Fatal error: Uncaught Error: Undefined constant "Kanboard\Plugin\ThemeRevision\Controller\colorModel" in /var/www/app/plugins/ThemeRevision/Controller/ColorSwitchController.php:26 Stack trace: #0 /var/www/app/plugins/ThemeRevision/Plugin.php(66): Kanboard\Plugin\ThemeRevision\Controller\ColorSwitchController->setColor2Light() #1 /var/www/app/vendor/symfony/event-dispatcher/EventDispatcher.php(264): Kanboard\Plugin\ThemeRevision\Plugin->onStartup() #2 /var/www/app/vendor/symfony/event-dispatcher/EventDispatcher.php(239): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch() #3 /var/www/app/vendor/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners() #4 /var/www/app/app/Middleware/BootstrapMiddleware.php(21): Symfony\Component\EventDispatcher\EventDispatcher->dispatch() #5 /var/www/app/app/Core/Controller/Runner.php(62): Kanboard\Middleware\BootstrapMiddleware->execute() #6 /var/www/app/app/Core/Controller/Runner.php(28): Kanboard\Core\Controller\Runner->executeMiddleware() #7 /var/www/app/index.php(9): Kanboard\Core\Controller\Runner->execute() #8 {main} thrown in /var/www/app/plugins/ThemeRevision/Controller/ColorSwitchController.php on line 26

As with 0.8.0 there is no ColorSwitchController.php so the error does not appear.

greyaz commented 2 years ago

@jlkDE, thank you for your feedback.

I'm not sure if the bug can be fixed, please have a try and tell me the results:

  1. Remove your "ThemeRevision" folder
  2. Reinstall ver 1.0.2 via gti clone
  3. Open the file ThemeRevision/Helper/ColorSwitchHelper.php and edit the codes both in line 15 and line 23: from
    $this->container[colorModel] = $this->container->factory(function ($c) {

    to (pay attention to the apostrophes)

    $this->container['colorModel'] = $this->container->factory(function ($c) {

Please also tell me your Kanboard and PHP version.

greyaz commented 2 years ago

@jlkDE both bugs should be fixed, please clone the main branch again and have a try.

jlkDE commented 2 years ago

Hey @greyaz, thank you much for fixing all this quick, great job! Indeed everything now works as intended and I am really enjoying the dark theme so far. My team really likes it too as it matches a more modern look and after some small adjustments via a custom CSS I am sure that I will keep this theme for longer. :)

greyaz commented 2 years ago

I'm so happy after reading your comments, thank you :)