Skip to content

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

Closed
wants to merge 1 commit into from

Conversation

nfourteen
Copy link
Contributor

Description

Disable Magento_Analytics (aka Advanced Reporting) by default and provide clearer message if an industry is not provided.

Fixed Issues (if relevant)

  1. magento/magento2#12866: Can't Disable Advanced Reporting

Manual testing scenarios

  1. Install new Magento 2.2 instance and Stores > Configuration > General > Advanced Reporting > Advanced Reporting Service should be set to Disable after install
  2. Go to Stores > Configuration > General > Advanced Reporting and change Advanced Reporting Service to Enable/Disable and press Save Config. If an Industry is not provided, then the Please select an industry. error message is shown rather than Please select a vertical.

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

…vide clearer message if an industry is not provided
@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Dec 25, 2017

CLA assistant check
All committers have signed the CLA.

@@ -30,7 +30,7 @@ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface
'scope' => 'default',
'scope_id' => 0,
'path' => 'analytics/subscription/enabled',
'value' => 1
'value' => 0
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor Author

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.

@magento-engcom-team magento-engcom-team added the Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release label Dec 27, 2017
@okorshenko okorshenko modified the milestones: December 2017, January 2018 Jan 8, 2018
@okorshenko okorshenko modified the milestones: January 2018, February 2018 Feb 7, 2018
@okorshenko okorshenko modified the milestones: February 2018, March 2018 Mar 1, 2018
@okorshenko okorshenko modified the milestones: March 2018, April 2018 Apr 16, 2018
@okorshenko okorshenko modified the milestones: April 2018, May 2018 May 18, 2018
@okorshenko okorshenko removed this from the May 2018 milestone May 31, 2018
@slavvka slavvka self-assigned this Oct 5, 2018
@slavvka
Copy link
Member

slavvka commented Oct 5, 2018

@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

@slavvka
Copy link
Member

slavvka commented Oct 5, 2018

@nfourteen According to the info from our PM, it should be on by default. So I am closing this PR

@slavvka slavvka closed this Oct 5, 2018
@nfourteen
Copy link
Contributor Author

@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 nfourteen reopened this Oct 11, 2018
@slavvka
Copy link
Member

slavvka commented Oct 11, 2018

@nfourteen I agree. Please provide the changed code

@slavvka
Copy link
Member

slavvka commented Oct 18, 2018

@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 slavvka closed this Oct 18, 2018
@nfourteen
Copy link
Contributor Author

nfourteen commented Oct 19, 2018

@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.

@nfourteen nfourteen reopened this Oct 19, 2018
@okorshenko
Copy link
Contributor

Hi @nfourteen
Thank you for your contribution. We are closing this PR since the proposed solution cannot be accepted in the current state. We are working with PO right now to guide you for a proper solution.

Thank you for your patience

@slavvka
Copy link
Member

slavvka commented Oct 23, 2018

@nfourteen Thank you for your attitude but this issue has been already fixed in this PR #15366

@slavvka slavvka closed this Oct 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release Line: 2.2 Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants