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

🐛 Set default value for undefined variable #162

Merged
merged 1 commit into from
Dec 13, 2018

Conversation

Joel-James
Copy link
Contributor

There is an undefined error when we install the plugin for the first time and if Redis is not available.

@rahulsprajapati
Copy link
Contributor

Hello @Joel-James

I've tried to reproduce this issue, but couldn't able to reproduce the issue. Can you please give me steps to reproduce this issue.

Steps I tried for reproduce the issue:

  1. Setup site without any cache on server and installed/activated nginx-helper and checked settings page.

  2. Tested by adding constant redis constant values in wp-config.php also ( there was no cache enabled ).

      define( 'RT_WP_NGINX_HELPER_REDIS_HOSTNAME', '127.0.0.1' );
      define( 'RT_WP_NGINX_HELPER_REDIS_PORT', '6379' );
      define( 'RT_WP_NGINX_HELPER_REDIS_PREFIX', 'nginx-cache:' );
    

@LeoColomb
Copy link

LeoColomb commented Dec 10, 2018

@rahulsprajapati

Can you please give me steps to reproduce this issue.

  1. Enable FastCGI cache and do not set any constant.
  2. Enable nginx-helper.

@LeoColomb
Copy link

Edited my previous reply for more general steps.

This is because of these lines, where the array returned may not contain redis_enabled_by_constant:

if ( ! $is_redis_enabled ) {
return $data;
}

@rahulsprajapati
Copy link
Contributor

Thank you @LeoColomb for more details on this. I'll look into this soon.

@rahulsprajapati
Copy link
Contributor

Got the error, and this PR fix the issue.
Thank you @Joel-James and @LeoColomb

@rahulsprajapati rahulsprajapati merged commit 7bced91 into rtCamp:master Dec 13, 2018
@LeoColomb
Copy link

@rahulsprajapati Is it possible to make a release with the fix? Thanks!

@Joel-James Joel-James deleted the fix/undefined_var branch January 19, 2019 06:32
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

Successfully merging this pull request may close these issues.

3 participants