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

"Save All Changes" button missing #265

Open
HandyGadget opened this issue Mar 2, 2022 · 3 comments
Open

"Save All Changes" button missing #265

HandyGadget opened this issue Mar 2, 2022 · 3 comments
Assignees

Comments

@HandyGadget
Copy link

With only two plugins installed and activated there is no blue button to save changes.

[Operating System]
Description: Ubuntu 20.04.4 LTS

[NGINX]
Branch: mainline
Version: 1.20.2

[PHP]
Info: PHP 8.0.16 (cli) (built: Feb 21 2022 14:42:00) ( NTS )

@arafatkn
Copy link
Contributor

arafatkn commented Mar 3, 2022

Hello @HandyGadget , Thanks for sharing the issue with us.

As i have checked in PHP 8.0 and WP 5.8, in Nginx Helper settings page, there is a blue button showing "Save All Changes".
Please check the plugin's settings page again.

Can you please share more details? i.e. screenshot or video or related error_log so that the issue can be identified.

@asule-star
Copy link

asule-star commented Oct 8, 2022

I actually encountered this issue recently using php 8.1. Also tested on php 7.4 and this doesn't happen.

On further investigation, I noticed the issue could be fixed by setting the "$recursive" parameter to true to ensure all directories are created in the path.

Code path location:
/nginx-helper/admin/partials/nginx-helper-general-options.php

Code line causing issue (line: 630)
if ( ! is_dir( $log_path ) ) { mkdir( $log_path ); // error happens here }

Code with proposed fix (line: 630)
if ( ! is_dir( $log_path ) ) { mkdir( $log_path,0777,true ); // setting $recursive to true fixes the issue }

@danish17
Copy link

@HandyGadget :
Upon analyzing the code, this issue may happen if the directories are non-existent and the code preceding /nginx-helper/admin/partials/nginx-helper-general-options.php#630 throws a fatal error OR submit_button() fails for some reason.

As we do not have the screenshot available, or the details pertaining to the environment, the true cause of the problem could not be ascertained.

Regarding the proposed fix

@asule-star: If ( ! is_dir( $log_path ) ) { mkdir( $log_path ); fails to create the directory, it will throw a warning instead of a fatal error, i.e., the code execution will not stop. Even if it does, something like this will happen:

image

# Warning if #630 fails to create the directory:
Warning: mkdir(): No such file or directory in /app/wordpress/wp-content/plugins/nginx-helper/admin/partials/nginx-helper-general-options.php on line 630
Can't write on log file.

Check you have write permission on /app/wordpress/wp-content/uploads/nginx-helper/nginx.log

The issue reported was for missing button, not the whole section. Is that correct? @HandyGadget @asule-star

I would request you to kindly share the screenshot and the server environment being used. If possible, please share the error log as well.

Tested on:

Server architecture: Linux 5.15.0-58-generic x86_64
Web server: nginx/1.17.10
PHP version: 8.1.14 (Supports 64bit values) (also on: PHP 7.4, 8.0)
PHP SAPI: fpm-fcgi
Version: 6.1.1

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

4 participants