seblucas / cops

Calibre OPDS (and HTML) PHP Server : web-based light alternative to Calibre content server / Calibre2OPDS to serve ebooks (epub, mobi, pdf, ...)
http://blog.slucas.fr/en/oss/calibre-opds-php-server
GNU General Public License v2.0
1.44k stars 229 forks source link

Server side render problem with custom column #288

Closed PaceyIV closed 8 years ago

PaceyIV commented 8 years ago

In my config_local.php I have declared some custom column:

$config['cops_calibre_custom_column_list'] = array ("read", "pages");

They are defined in the database as:

1 | read | Letto | bool | 0 | 1 | {} | 0 | 0 | 4 | pages | Pagine | int | 0 | 1 | {"number_format": "{0:,}"} | 0 | 0 |

On my Kindle Touch (4th generation) and on Google Chrome with server side render enabled on all device ( $config['cops_server_side_render'] = ".") I get the 500 error code:

[Thu Aug 11 13:53:08.337531 2016] [:error] [pid 9746] [client 192.168.1.106:53728] PHP Fatal error: Cannot use object of type CustomColumn as array in /media/data/ebooks/cops/resources/doT-php/doT.php(94) : runtime-created function on line 160, referer: http://192.168.1.1/ebooks/index.php?page=2&id=G&db=0

slgray commented 8 years ago

Some here with custom column and server side render.

2016/10/01 07:38:02 [error] 515#0: *125 FastCGI sent in stderr: 
"PHP message: PHP Fatal error:Cannot use object of type CustomColumn as array in 
/home/pi/cops/resources/doT-php/doT.php(94) :runtime-created function on line 160" 
while reading response header from upstream, client: x.x.x.x, server: , 
request: "GET /index.php?page=7&id=3 HTTP/1.1", upstream: 
"fastcgi://unix:/var/run/php5-fpm.sock:", host: "x.x.x.x", referrer: "http://x.x.x.x/index.php?page=7&id=3"

Here are checkconfig result form kindle: checkconfig

slgray commented 8 years ago

I work around this issue by disable Server side render for Kindle 3. So far so good.

$config['cops_server_side_render'] = "Kindle\/1\.0|Kindle\/2\.0|EBRD1101|EBRD1201|cybook";

seblucas commented 8 years ago

@slgray

is your Kindle still usable with client side rendering ? If yes, I'll remove it from config_default for the next revision.

PaceyIV commented 8 years ago

With client side rendering on Kindle Touch (User Agent Kindle/3.0+) there are too many redraws of the page, and the selected item blinks for a while.

slgray commented 8 years ago

@seblucas It still works great with eink theme. My device is Kindle Paperwhite (UserAgent: "Mozilla/5.0 (X11; U; Linux armv7l like Android; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/533.2+ Kindle/3.0+") @PaceyIV maybe you can try eink theme.

PaceyIV commented 8 years ago

I've tried eink them with client rendering and server side rendering: it works fine with both solution.