Skip to content
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

Running core:delete-logs-data with option --no-interaction doesn't do anything #9316

Closed
ekooiker opened this issue Dec 1, 2015 · 1 comment
Labels
c: Usability For issues that let users achieve a defined goal more effectively or efficiently. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement.
Milestone

Comments

@ekooiker
Copy link

ekooiker commented Dec 1, 2015

When I run the command: ./console core:delete-logs-data --dates=2015-11-20,2015-11-23 it asks the following question:
You are about to delete log data. This action cannot be undone, are you sure you want to continue? (Y/N) which defaults to No

This is fine, but when I add the option --no-interaction it still defaults to No so doesn't do anything.

I could not find a setting for this, so I changed the function askForDeleteConfirmation in plugins/CoreAdminHome/Commands/DeleteLogsData.php to this

private function askForDeleteConfirmation(InputInterface $input, OutputInterface $output)
{
    if ($input->getOption('no-interaction')) {
        return true;
    }
    $helper   = $this->getHelper('question');
    $question = new ConfirmationQuestion('<comment>You are about to delete log data. This action cannot be undone, are you sure you want to continue? (Y/N)</comment> ', false);

    return $helper->ask($input, $output, $question);
}

Could this fix be added in a next release?

@tsteur tsteur added Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. c: Usability For issues that let users achieve a defined goal more effectively or efficiently. labels Dec 1, 2015
@tsteur tsteur added this to the Short term milestone Dec 1, 2015
@tsteur
Copy link
Member

tsteur commented Dec 1, 2015

FYI: Same was asked for in #8469 but for a different command. Therefore putting it in same milestone.

Can you maybe issue a Pull Request for this change? (if you are familiar with Github + PHP)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Usability For issues that let users achieve a defined goal more effectively or efficiently. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement.
Projects
None yet
Development

No branches or pull requests

2 participants