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

Fix regression in configuration scope code. Refs #1417 #1418

Merged

Conversation

colinmollenhour
Copy link
Member

Description (*)

Fixes regression as reported by @addison74 in #1417

Fixed Issues (if relevant)

Config scope switching is fixed.

@addison74
Copy link
Contributor

addison74 commented Jan 22, 2021

This change will solve all issues reported by those who could not save the modifications made in system configuration section. Personally I was affected by not seeing Template Hints working in Frontend then I started a deep investigation. Fortunately I found the issue. I tested this solution and working.

@colinmollenhour: I appreciate for your fast reaction.

Copy link
Contributor

@kiatng kiatng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and worked.

@kiatng kiatng added the bug label Jan 23, 2021
Copy link
Contributor

@sreichel sreichel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did not test, but (bool)(int)$field-> is also used for _isValidField($field).

Edit: tested

@addison74
Copy link
Contributor

There is a similar solution already from the past as @sreichel mentioned before in file /app/code/core/Mage/Adminhtml/Model/Config/Data.php. In this case it was done correctly (lines 449 - 474):

/**
 * Check field visibility by scope
 *
 * @param Mage_Core_Model_Config_Element $field
 * @return bool
 */
protected function _isValidField($field)
{
    if (!$field) {
        return false;
    }

    switch ($this->getScope()) {
        case self::SCOPE_DEFAULT:
            return (bool)(int)$field->show_in_default;
            break;
        case self::SCOPE_WEBSITES:
            return (bool)(int)$field->show_in_website;
            break;
        case self::SCOPE_STORES:
            return (bool)(int)$field->show_in_store;
            break;
    }

    return true;
}

@sreichel
Copy link
Contributor

@Flyingmana can you pls make a hotfix release? This should not wait for days/weeks.

@sreichel sreichel requested a review from tmotyl January 25, 2021 21:09
@sreichel sreichel merged commit eaf4354 into OpenMage:1.9.4.x Jan 25, 2021
@sreichel sreichel added this to the Release 19.4.11 / 20.0.7 milestone Jan 25, 2021
@github-actions
Copy link
Contributor

Unit Test Results

1 files  ±0  1 suites  ±0   0s ⏱️ ±0s
0 tests ±0  0 ✔️ ±0  0 💤 ±0  0 ❌ ±0 
2 runs  ±0  2 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit eaf4354. ± Comparison against base commit bbd05be.

@Flyingmana
Copy link
Contributor

@sreichel I cant, my calendar is already full for the next 2 weeks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Component: Adminhtml Relates to Mage_Adminhtml
Projects
None yet
6 participants