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

Console command generate:report not geting all available dimensions #6481

Closed
mgazdzik opened this issue Oct 20, 2014 · 5 comments
Closed

Console command generate:report not geting all available dimensions #6481

mgazdzik opened this issue Oct 20, 2014 · 5 comments
Assignees
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Milestone

Comments

@mgazdzik
Copy link
Contributor

I tried to use generate: tasks to scaffold plugin defining new reports and dimensions. Firstly I created dimensions, and then I tried to create report using those dimensions. I got following error:
"Leave dimension either empty or use an existing one. You can also create a new dimension by calling .console generate:dimension before generating this report."

After short investigation I think bug lies in this line
https://github.com/piwik/piwik/blob/master/plugins/CoreConsole/Commands/GenerateReport.php#L226

This loop doesn't notice newly created dimensions and therefore it's impossible to create report for it.
I think that loop should iterate over dimensions (columns?) themself instead of already existing reports.

I had enabled development options in config and cleared tmp/ directories so I don't think it's cache-related.

Or if it's false-positive let me know how to proceed with generating report for previously created new dimension.

@mgazdzik mgazdzik changed the title Console command generate:report not seeing all available dimensions Console command generate:report not geting all available dimensions Oct 20, 2014
@mattab mattab added the Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. label Oct 21, 2014
@mattab
Copy link
Member

mattab commented Oct 21, 2014

Thanks for the report! cc @tsteur

@tsteur
Copy link
Member

tsteur commented Oct 21, 2014

Can you check if it works?

BTW: In case development mode is enabled caches - should - be ignored anyway.

@tsteur tsteur closed this as completed Oct 21, 2014
@tsteur tsteur self-assigned this Oct 21, 2014
@tsteur tsteur added this to the Piwik 2.8.1 milestone Oct 21, 2014
@mgazdzik
Copy link
Contributor Author

@tsteur - yes it's working now, but still there is a minor flaw in generator use flow I think ;)
When scaffolding plugin user can generate dimensions, and reports without needing to activate plugin. However without activating plugin - dimensions defined by this specific plugin are not being recognized. Only after activating plugin they become available.
I think it would improve a bit feeling of scaffolding plugin using couple of CLI commands called one after another in row, without having to explicitly activating plugin which is 'not ready yet', what do you think ?

Lines to be possibly changed are:
https://github.com/piwik/piwik/blob/master/core/Plugin/Dimension/ActionDimension.php#L219
https://github.com/piwik/piwik/blob/master/core/Plugin/Dimension/ConversionDimension.php#L162
https://github.com/piwik/piwik/blob/master/core/Plugin/Dimension/VisitDimension.php#L282

@tsteur
Copy link
Member

tsteur commented Oct 21, 2014

Not sure. Maybe we could only include dimensions from this plugin you are currently working on / generating the report for? Even if it is deactivated? Guess this is the most common use case anyway

@mgazdzik
Copy link
Contributor Author

Actually it would make even more sense that way. +1

tsteur added a commit that referenced this issue Oct 28, 2014
…cted plugin even if the plugin is not enabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

No branches or pull requests

3 participants