retour-for-kirby
retour-for-kirby copied to clipboard
Version 4.0.0 causes error when opening redirects page in panel
Describe the bug
When I install Retour for Kirby 4.0.0 on a site with Kirby version 3.6.2, I can't open the redirects page in the panel.
It's giving me the following error in a popup: Call to a member function toArray() on bool
Also request to the redirects page fails and gives a 500 status code without any specific error.
Steps to reproduce
- Install Retour for Kirby using Composer
- Go to the panel and click on the Redirects button
Expected behavior
That the redirects page will show.
Additional context
- The Kirby CMS uses the Dutch language as the default language.
E.g. screenshots
Context
- Browser: Chrome 98
- Kirby version: 3.6.2
- Retour version: 4.0.0
- Retour config: /
Any retour specific config set? Can you check if site/config/retour.yml
exists when the error appears?
@distantnative, I didn't add any specific retour to the config file, It's a clean install. The retour.yml didn't exist after installation, I hoped adding it would solve the error. But sadly not. (I tried an empty retour.yml file and one with a redirect set manually)
After some digging I found out that de dates table doesn't exist in the log.sqlite, which makes the database query in the stats function in src/classes/Log.php fail. When I disable the log feature, the page is working again.
@timluigjes do you know if the log.sqlite
file was there before? or did Retour create it from scratch with that flaw?
@distantnative, It was created from scratch. This morning I tried it with a fresh Kirby CMS install and I got the same error.
I'm sorry that this hasn't been fixed yet but still haven't been able to reproduce it on my end
I am getting this error too. Locally everything works.
Apache server production and localhost, PHP 8.0.24, Kirby 3.7.3, Retour 4.2.0
All the same, as @timluigjes noted.
Updated a client's website earlier this week to the latest version of Kirby 3.7 with Retour 4.2.0. Sadly the error still occurs, When the logging functionality is disabled, the panel is viewable.
@mynameisfreedom if you add the following to the Kirby config, it will work again: 'distantnative.retour' => ['logs' => false]
I was quite busy the last couple of months, but later this week I'll try to resolve this error and provide a PR if I found a solution.
I'm digging into this error now... as far is I could get, there is an issue with the SQL here. The error is Error: near "with": syntax error
The reason is, that the ability for "recursive-select" was introduced in sqlite 3.34.0. The host I'm running is only capable of sqlite 3.7... I'm not able to get an update for that so I guess one needs to alter the query...?
@gerricom first of all thanks a lot for getting to the bottom of this. I think this explains it!
I'd need help to see if there is a different sql statement that achieves the same.
Or if there is a way I can check the SQLite version in PHP and throw an error if it doesn't support the required functions.
I run into the same issue. It works fine on my localhost. On my production server it creates the database in the logs folder, but I get the error Call to a member function toArray() on bool
I have Kirby 3.9.4 and retour 4.4.2 installed. I can't figure out which sqlite version is running on my production sever. How can i get this to work?
@movingwater As you probably read this seems to be really about the SQLite version, so probably getting in touch with your provider and figuring out if you/they can update it