e-alfred / epubreader

EPUB/CBR/PDF reader app for Nextcloud
GNU Affero General Public License v3.0
79 stars 21 forks source link

Settings for the default viewer are not working with NC 20.0.0 #20

Open ummon29 opened 3 years ago

ummon29 commented 3 years ago

Running epubreader (1.4.2) on Nextcloud 20.0.0 I'm not able to change the default viewer settings for Epub, PDF, CBR/CBZ. Clicking one of the checkboxes triggers the box and the save dialog opens but never finishes. When the page is reloaded the setting is switched back to the previous state. When activated epubreader is the default viewer for all options (Epub, PDF, CBR/CBZ) and I'm not able to deactivate the settings.

Thanks for your great work.

e-alfred commented 3 years ago

Can you test if the problem still appears with release 1.4.4? Do you see any error in the Browser console or logs?

ummon29 commented 3 years ago

It changed a bit. The save dialog still stays forever but is seems to change the underlying configuration. PDFs are now opened with the PDF viewer. Sadly as a side effect I now get an internal server error when I try to open an epub or cbz.

I get the following logmessage:

[index] Error: Doctrine\DBAL\Exception\TableNotFoundException: An exception occurred while executing 'SELECT * FROM oc_reader_prefs WHERE scope=? AND file_id=? AND user_id=?' with params ["epubreader", 0, "ummon29"]:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_reader_prefs' doesn't exist at <>

  1. /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 169 Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException("An exception oc ... t", Doctrine\DBAL\Dr ... ]})
  2. /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 149 Doctrine\DBAL\DBALException::wrapException(Doctrine\DBAL\Driver\PDOMySql\Driver {}, Doctrine\DBAL\Dr ... ]}, "An exception oc ... t")
  3. /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Statement.php line 162 Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Doctrine\DBAL\Driver\PDOMySql\Driver {}, Doctrine\DBAL\Dr ... ]}, "SELECT * FROM ` ... ?", {1: "epubreader",2: 0,3: "ummon29"})
  4. /var/www/nextcloud/lib/public/AppFramework/Db/Mapper.php line 253 Doctrine\DBAL\Statement->execute()
  5. /var/www/nextcloud/lib/public/AppFramework/Db/Mapper.php line 341 OCP\AppFramework\Db\Mapper->execute("SELECT * FROM ` ... ?", ["epubreader",0,"ummon29"], null, null)
  6. /var/www/nextcloud/apps/epubreader/lib/Db/PreferenceMapper.php line 47 OCP\AppFramework\Db\Mapper->findEntities("SELECT * FROM ` ... ?", ["epubreader",0,"ummon29"])
  7. /var/www/nextcloud/apps/epubreader/lib/Service/PreferenceService.php line 44 OCA\Epubreader\Db\PreferenceMapper->get("epubreader", 0, null)
  8. /var/www/nextcloud/apps/epubreader/lib/Service/PreferenceService.php line 77 OCA\Epubreader\Service\PreferenceService->get("epubreader", 0, null)
  9. /var/www/nextcloud/apps/epubreader/lib/Controller/PageController.php line 103 OCA\Epubreader\Service\PreferenceService->getDefault("epubreader")
  10. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 169 OCA\Epubreader\Controller\PageController->showReader()
    1. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 100 OC\AppFramework\Http\Dispatcher->executeController(OCA\Epubreader\C ... {}, "showReader")
    2. /var/www/nextcloud/lib/private/AppFramework/App.php line 152 OC\AppFramework\Http\Dispatcher->dispatch(OCA\Epubreader\C ... {}, "showReader")
    3. /var/www/nextcloud/lib/private/Route/Router.php line 308 OC\AppFramework\App::main("OCA\Epubreader ... r", "showReader", OC\AppFramework\ ... {}, {action: null,_r ... "})
    4. /var/www/nextcloud/lib/base.php line 1009 OC\Route\Router->match("/apps/epubreader/")
    5. /var/www/nextcloud/index.php line 37 OC::handleRequest()

GET /index.php/apps/epubreader/?file=%2Fremote.php%2Fwebdav%2Febook%2FA_book.epub&type=application%2Fepub%2Bzip from 192.168.x.x by ummon29 at 2020-11-01T13:43:17+00:00

ummon29 commented 3 years ago

Version 1.4.5 (on NC 20.0.1) is working better than 1.4.4 . No internal server error anymore. epub, pdf and cbz are opening fine in epubreader. The configuration is still not working for me. Changing an option in Settings -> Additional settings changes the checkbox and shows a save dialog that stays forever. A reload of the page shows all boxes as checked again. an pdf is still opened in epubreader when clicked. The 'view' option in the menu is opening the pdf in PDF viewer as a workaround. 1.4.5 and 1.4.3 behaves similar in that regard. Changing the options doesn't give me any output in the log.

rhein commented 3 years ago

V 1.4.5 on NC 20.0.4 shows the same for me. Classic install, not docker or snap.

I looked at the http traffic, and it seems the ajax post request from the admin page to /index.php/apps/epubreader/ajax/personal.php never gets through, the server responds immediatelly with a 302 redirect to /apps/dashboard - the request never even reaches personal.php

Might be due to some csrf protection setting or just a misconfiguration on my side, I am still trying to find some documentation on how requests are actually routed on NC.

gpgmailencrypt commented 3 years ago

Having the same problem. The browser (firefox) throws following error

Uncaught TypeError: t.data is undefined
    finishedAction msg.js:81
    finishedSaving msg.js:66
    afterSave settings.js:15
    jQuery 7
    save settings.js:12
    jQuery 9
    <anonymous> settings.js:19
    jQuery 6
    Webpack 6
msg.js:81:8
    finishedAction msg.js:81
    finishedSaving msg.js:66
    afterSave settings.js:15
    jQuery 7
    save settings.js:12
    jQuery 9
    <anonym> settings.js:19
    jQuery 6
    Webpack 6
sysadminstory commented 2 years ago

My PR #41 should fix the issue about the redirect done after changing settings