Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README.md states compatibility to 1.7.3+ but should be 1.8+ #52

Open
gmolop opened this issue Aug 25, 2022 · 0 comments
Open

README.md states compatibility to 1.7.3+ but should be 1.8+ #52

gmolop opened this issue Aug 25, 2022 · 0 comments

Comments

@gmolop
Copy link

gmolop commented Aug 25, 2022

PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function amp_ajax_button_check()

yourls_table_add_row function introduce second argument $keyword in v1.8, therefore plugin will throw error on previous versions.

https://github.com/YOURLS/YOURLS/blob/1.7.3/includes/functions-html.php#L560
$actions = yourls_apply_filter( 'table_add_row_action_array', $actions );
https://github.com/YOURLS/YOURLS/blob/1.8/includes/functions-html.php#L567
$actions = yourls_apply_filter( 'table_add_row_action_array', $actions, $keyword );

Quick compatibility fix will be to redefine the function amp_ajax_button_check as follow:

function amp_ajax_button_check( $actions, $keyword = null ) {
    // fallback compatibility prior v1.8
    if (is_null($keyword)) global $keyword;
    // define the amp capabilities that map to the buttons
    ...
}

But I think is better to update readme just in case something else cause problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant