-
Notifications
You must be signed in to change notification settings - Fork 116
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
Issue 379 #387
Issue 379 #387
Conversation
- get_instance() of WP_Stream_Install instead of calling check() method
- Add constructor method to initiate class then call check(); - Added prompt_update() method to handle user controlled db update
- Added final code documentation to class methods
- Fixed correct $_REQUEST keys to check for during each stage of update routine
- Replace esc_html with esc_html_e
- added error_log() calls to test installing over multiple versions - fixed bug - move the update database button to the end of the function
- Moved the database user upgrade process outside of the plugin list table hook. 1st Update Database notice is still there but rest of routine lives on it's own.
- Stores current connector versions and only fires callback function when version changes
- correct wp_stream_update query arg
…db update" Reverting the screwy conflict merges This reverts commit 1fceb01.
…xxx as naming convention" This reverts commit 6b6d69d.
- Added filter for extensions call there own update routine - Moved update routines to separate file
* To add your own stream extension plugin database update routine | ||
* use the filter and return your version that updating from requires an update | ||
* You must also make the callback function available in the global namespace on plugins loaded | ||
* use the wp_stream_update_{version_number} version number must be a 3 character string number with no periods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@c3mdigital Would it be at least 3 chars or exactly 3 chars?
Just thinking about double digit patch releases, like 1.4.12
, which I believe is compatible with the semver spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fjarrett Actually it wouldn't matter as long as their callback function is the same
- Added filter for extensions call there own update routine - Moved update routines to separate file
@fjarrett I just did the exact same steps above but this time downloaded version 1.1.2 and got the error message. |
@c3mdigital OK good, so I'm not crazy. |
- Remove early return to allow multiple version updates to run - return false early only if update function fails - update functions should always return version string unless fail then they should return error object or false
@fjarrett The problem was the |
…issue-379 Conflicts: includes/db-updates.php
@c3mdigital Right now, it's required that the plugin be updated via the WP dashboard in order for the DB update available message to appear, which is possible thanks to However, if you manually overwrite the plugin files (like via FTP) you then have to deactivate/reactivate the plugin for the message to appear. This could cause a problem if the DB schema were to change via an update but the user never knew an update was available. Would there be anything wrong with running |
@fjarrett The check method already runs all the time on init. |
@c3mdigital Oh I see that now. OK so I was mistaken about having to deactivate/reactivate. Going to test again now. |
@c3mdigital OK the dialog works without the need to deactivate! Awesome. However, the upgrade routines don't appear to be working:
|
@fjarrett I see the issue. If we change that to |
- Make sure db update function runs when updating from version that has update routine function
@c3mdigital The upgrades are still not executing. I don't think the version compare operator is the problem because the settings migrations were introduced in 1.3.0: https://github.com/x-team/wp-stream/blob/issue-379/includes/db-updates.php#L129 |
@fjarrett I see. I thought that was from version 1.2.8. Let me do some testing but it looks like running the update on the |
@fjarrett Can you test again. Since the update needs the connectors to be loaded I added a call to reload the class so the update can attach to the |
@c3mdigital Worked! /five |
Conflicts: includes/admin.php stream.php
|
||
do_action( 'wp_stream_before_db_update_' . $db_version, $current_version ); | ||
|
||
if ( version_compare( $db_version, '1.3.2', '<' ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@c3mdigital Just wanted to check with you on this one, this version compare shouldn't be required, right?
/cc @lukecarbis
… but add a check to see if the column exists
Fix #379
Fix #388
@fjarrett Please test and review