@oswaldquek opened this issue on July 30th 2015

This faq http://piwik.org/faq/how-to/#faq_17931 describes how to add a custom variable to piwik. If I just run ./console however it says I can run it with --no-interaction. However this doesn't work. Looking at https://github.com/piwik/piwik/blob/3.0/plugins/CustomVariables/Commands/SetNumberOfCustomVariables.php#L58 it looks like the code doesn't check to see if the --no-interaction was specified before prompting the user for confirmation.

@tsteur commented on July 30th 2015

We currently do not really respect this option.

We could try to remove this option and completely ignore it, or respect it for some commands where it is possible. Not sure how many there are. I presume it shouldn't be that many as we usually do not ask for input if all needed information is provided. If not all information is provided and --no-interaction is set, we'd probably need to exit immediately showing an error? That would be some more work I reckon

@oswaldquek commented on July 30th 2015

I'm not sure how many commands could do without interaction mode either. But maybe it could work for the use case of ./console customvariables:set-max-custom-variables? The only interaction is asking the user to enter 'y' or 'N'. Something that isn't really necessary. And probably easy to fix (except I don't know php so stopped short of fixing it).

Just to give context, I was trying to add a custom variable via puppet rather than going to all my environments which had a piwik instance running and manually adding the custom variable. This was not doable since I couldn't run set-max-custom-variables in no interaction mode.

@tsteur commented on July 30th 2015

Already thought you have such a use case. It shouldn't be too much work to make it work indeed

@oswaldquek commented on July 30th 2015

Thanks :)

@mattab commented on September 18th 2015

Restricted scope of issue. @oswaldquek Pull request is welcome :-)

This issue was closed on January 10th 2016
Powered by GitHub Issue Mirror