View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000973 | bareos-core | webui | public | 2018-06-28 11:19 | 2019-12-18 15:25 |
Reporter | jhon | Assigned To | |||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | open | ||
Platform | Linux | OS | CentOS | OS Version | 7 |
Product Version | 18.3.1 | ||||
Summary | 0000973: WEBUI Restore Too Many Files error caused by bad JSON [issue present at least from 17.2.4] | ||||
Description | I solved this issue on my 17.2.4 install but when I looked at the code in the master, I saw that this issues was "fixed". However, the "fix" in the master is not good and will also cause bad JSON to be uploaded to the webui causing the "too many files" error box. | ||||
Steps To Reproduce | For the current master branch: - go to the restore ui - try to open a directory without subdirectories. For the 17.2.4 version: - go to the restore UI - try to open a directory containing one directory and multiple files. | ||||
Additional Information | For the current master, the issue is on line 361 of /master/webui/module/Restore/src/Restore/Controller/RestoreController.php [https://github.com/bareos/bareos/blob/master/webui/module/Restore/src/Restore/Controller/RestoreController.php] This line is now: if($fnum > 0) { This does not take into account the case when there are no subdirs in this subtree and will add a stray comma before the files json elements, causing an error in the browser. Changing this line to if( $tmp > 0 && $fnum > 0 ) { solves the problem. ($tmp is set to $dnum and holds the number of directories in the subtree. --- Additional info: In the 17.2.4 branch, this line is actually different, but also wrong: if( $tmp > 2 && $fnum > 0 ) { The $tmp > 2 is wrong since directories with only 1 or 2 subdirs won't get the comma added and a JSON error complaining about that will result. I suspect the current state of the file in master is a result of someone "fixing" this problem incorrectly. | ||||
Tags | No tags attached. | ||||
Thank you for the report and the already fixed line. I tested this and submitted a PR against our master branch. Furthermore I'd like to encourage you to just open a pull request yourself the next time. That case is likely to be handled much faster than opening a bug report here! |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2018-06-28 11:19 | jhon | New Issue | |
2018-08-07 14:01 |
|
Assigned To | => aron_s |
2018-08-07 14:01 |
|
Status | new => assigned |
2018-08-08 13:09 |
|
Note Added: 0003095 | |
2018-08-08 13:09 |
|
Status | assigned => resolved |
2019-12-18 15:25 | arogge | Status | resolved => closed |