[JENKINS-25654] Do not show restore button if there are no configs available. #54
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hotfix for JENKINS-25654.
We can't restore a job when there's no stored config file available.
When a job gets deleted, we can't save a config file.
If a job is enabled and get's deleted, jenkins first deactivates the job and then deletes ist. So in this case we have a config file.
But if a job is deactivated and the job gets deleted, jenkins doesn't deactivate it (because it is already) and deletes it directly. So in the case when a job is deactivated, JobConfigHistory gets installed, no more configuration for this job get performed and the job gets deleted, we don't have any config file we could restore.
A workaround for this case is, that we don't show the restore button, when there's no config file available.