-
-
Notifications
You must be signed in to change notification settings - Fork 909
Revert button is shown when comparing the current version with another version #3008
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
base: master
Are you sure you want to change the base?
Conversation
Co-Authored-By: Henry Pan <github@phy25.com>
splitbrain
left a comment
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.
This has currently a minor merge conflict and throws warnings on all pages. Can you have another look?
| if(!$INFO['ismanager'] || !$REV || !$INFO['writable']) { | ||
| // if we are comparing with the current version then | ||
| // allow reverting to the non current version | ||
| $comparedWithCurrent = in_array('current', $INPUT->ref('rev2')) || in_array('', $INPUT->ref('rev2')); |
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.
rev2 may not be set at all (for basically all page views except for when creating a diff) so this will throw a warning. I wonder if ref should be array instead?
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.
Can you post the files/errors? I pulled upstream changes and am not seeing them.
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.
I have these:
Warning: in_array() expects parameter 2 to be array, string given in ...\inc\Menu\Item\Revert.php on line 23
Warning: in_array() expects parameter 2 to be array, string given in ...\inc\Menu\Item\Revert.php on line 23
To enable E_ALL errors globally, create the file 'conf/report_e_all'.
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.
@kalenpw what's the status here? Can you fix the remaining issues?
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.
I believe so as they seem relatively minor, but I am still not able to reproduce the errors. I created conf/report_e_all, set error_reporting = E_ALL in php.ini, and added error_reporting(E_ALL); to doku.php for good measure. Is there something obvious I am missing?
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.
I've also noticed now it works when you first select current revision + old revision, but if you then change to current revision + any other old revision you can no longer restore.
Does that have to do with any of the changes to $INPUT->ref('rev2')?
Not sure if this is the cleanest way to handle it, but it works. Fixes #1339.