joshp23/YOURLS-Expiry

expiry

Naim-A opened this issue · 1 comments

I am using yourls 1.7.2 and added theexpiry addon. But if the addon is activated it breaks the admin screen, instead of a table of links there is just an error. Since the official version of yourls is 1.7.2 i have included your addition (commit dd78d7f + ) manually, but it did not help.

error on admin screen:

Fatal error: Uncaught Error: Call to undefined method ezSQL_pdo_YOURLS::fetchOne() in [path]/yourls/user/plugins/expiry/plugin.php:554 Stack trace: 
#0 [path]/yourls/includes/functions-plugins.php(150): show_expiry_tablerow('<tr id="id-y299...', '[short]', '[url]', '[title]', '[ip]', '2', 1525519301) 
#1 [path]/yourls/includes/functions-html.php(618): yourls_apply_filter('table_add_row', '<tr id="id-y299...', '[short]', '[url]', '[title]', '[ip]', '2', 1525519301) 
#2 [path]/yourls/admin/index.php(344): yourls_table_add_row('[short]', '[url]', '[title]', '[ip]', '2', 1525519301) 
#3 {main} thrown in [path]/yourls/user/plugins/expiry/plugin.php on line 554

Some thoughts:

The data on line 554: $expiry = $ydb->fetchOne($sql, $binds);
The error from your post: Call to undefined method ezSQL_pdo_YOURLS::fetchOne()

This has to do with a switch in sql library vendors, just pull the latest YOURLS code, it's working fine on my host running the latest 1.7.2-git-124.2e46b59 (heads/master) which appears as 1.7.3 in the admin page once deployed. I just pulled from git and everything is working fine.

EDIT: So, I wrote and tested this against YOURLS at commit dd78d7f, which includes a lot of other updates than the one small fix for this plugin. This is why the instructions call to use YOURLS at or above that commit. Just update and you should be fine.