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

fix(db-update): resolve database updates not working due to inaccessible admin-ajax.php #3420 #3458

Merged
merged 18 commits into from
Jul 13, 2018

Conversation

ravinderk
Copy link
Collaborator

@ravinderk ravinderk commented Jul 11, 2018

Description

This PR will resolve #3420

Note: Return false from give_test_ajax_works to simulate ajax error.

How Has This Been Tested?

Manually by running updates with pause and restart feature.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows has proper inline documentation.

if( ! give_test_ajax_works() ) {
echo sprintf(
'<div class="notice notice-warning inline"><p>%s</p></div>',
__( 'Admin ajax is inaccesible. We will update database with Ajax request instead of backgroud, so do not leave this page after starting database updates.', 'give' )
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DevinWalker Need text for this notice

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Give is currently updating the database. Please do not refresh or leave this page while the update is in progress.

@ravinderk
Copy link
Collaborator Author

ravinderk commented Jul 12, 2018

@DevinWalker Need help with this text:

image

This notice appears when ajax is inaccessible but now we can also run the update with Ajax instead of the background.

@DevinWalker my second thought on this that maybe we do not need this message anymore because DB updates works ( either background or manually )

@ravinderk
Copy link
Collaborator Author

@Benunc Do we have staging site where we can test this pr?

@ravinderk
Copy link
Collaborator Author

@DevinWalker I tired to create test video but my local server slows down when I start recording.

@DevinWalker
Copy link
Member

@ravinderk yes I agree with you. If AJAX is inaccessible, we can now still run the update. So just don't display that message.

@ravinderk
Copy link
Collaborator Author

@DevinWalker @Benunc I tested this code on https://secure.helpscout.net/conversation/608433170/20614?folderId=848135 and it is working fine for me.

Can you confirm?

@ravinderk ravinderk merged commit d075845 into release/2.2 Jul 13, 2018
@ravinderk ravinderk deleted the issue/3420 branch July 13, 2018 04:28
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.

None yet

2 participants