-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fix issue #12866: Can't Disable Advanced Reporting #12879
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
Conversation
…vide clearer message if an industry is not provided
@@ -30,7 +30,7 @@ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface | |||
'scope' => 'default', | |||
'scope_id' => 0, | |||
'path' => 'analytics/subscription/enabled', | |||
'value' => 1 | |||
'value' => 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest changing logic the validation, to better support the case with disabling validation, instead of disabling the feature on every new install. It was intended to be that way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ishakhsuvarov I can do that, but then what industry should be set as a default? Otherwise, on fresh installs the reporting service will be enabled, but the Industry will be empty and "will cause distortion of the analytics reports", thus breaking the validation logic of Magento\Analytics\Model\Config\Backend\Vertical::beforeSave()
. If the module is enabled by default and someone signs up for the service, will the Magento BI alert them that they need to select an Industry?
If that's handled, I can update the pull request so the module is enabled by default and update the disabling validation logic with:
// Magento\Analytics\Model\Config\Backend\Vertical
public function beforeSave()
{
if (empty($this->getValue()) && ($this->getFieldsetDataValue('enabled') === '1')) {
throw new LocalizedException(__('Please select an industry.'));
}
return $this;
}
which will allow disabling of the module, but make sure an Industry is supplied when trying to save the config with the module enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nfourteen Currently waiting for someone from product organization to describe the desired state of the feature.
Thank you for collaboration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ishakhsuvarov Thanks for the update. Let me know when you hear something as I'd be happy to edit this PR to reflect the desired state.
@nfourteen @ishakhsuvarov As far as I know Advanced Reporting should be on for 2.2 and 2.3 by default. But I am waiting for the exact response from PM |
@nfourteen According to the info from our PM, it should be on by default. So I am closing this PR |
@slavvka Ok, then there is another issue in that Advanced Reporting can't be disabled when it is on by default. See the related issue here: #12866. I think this PR should be reopened and the code changed to address the issue using one of the proposed solutions: see Reason and Proposed Solutions within the issue report. |
@nfourteen I agree. Please provide the changed code |
@nfourteen since the code you provided fixes the issue in a wrong way I am closing this PR. Please feel free to create a new one with a correct solution. Thank you! |
@slavvka This is a Magento core problem and an issue that needs to be fixed. However, since it's a Magento problem, I don't know how the PM wants to proceed. So, I'd be happy to fix Magento core code, but I need some direction as to which way Magento would like to proceed. Please stop closing this PR because it is a issue that needs to be resolved. Please have the PM review issue #12866 and advise which proposed solution would be acceptable or if another solution is desired. |
Hi @nfourteen Thank you for your patience |
@nfourteen Thank you for your attitude but this issue has been already fixed in this PR #15366 |
Description
Disable Magento_Analytics (aka Advanced Reporting) by default and provide clearer message if an industry is not provided.
Fixed Issues (if relevant)
Manual testing scenarios
Stores > Configuration > General > Advanced Reporting > Advanced Reporting Service
should be set to Disable after installStores > Configuration > General > Advanced Reporting
and change Advanced Reporting Service to Enable/Disable and press Save Config. If an Industry is not provided, then thePlease select an industry.
error message is shown rather thanPlease select a vertical.
Contribution checklist