Skip to content

Conversation

@kalenpw
Copy link
Contributor

@kalenpw kalenpw commented Mar 10, 2020

Not sure if this is the cleanest way to handle it, but it works. Fixes #1339.

Co-Authored-By: Henry Pan <github@phy25.com>
Copy link
Collaborator

@splitbrain splitbrain left a 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'));
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Copy link
Collaborator

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'.

Copy link
Collaborator

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?

Copy link
Contributor Author

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?

Copy link
Contributor Author

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')?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The "Restore" button is not shown neither in "Inline" mode nor in "Inline" -> "Side by Side"

4 participants