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

Replaced deprecated method getRegionJson() with getRegionJsonByStore(). #2375

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .github/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,6 @@ parameters:
count: 1
path: ../app/code/core/Mage/Adminhtml/Block/Cms/Page/Grid.php

-
message: "#^Call to an undefined method Mage_Core_Helper_Abstract\\:\\:getRegionJsonByStore\\(\\)\\.$#"
count: 1
path: ../app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Region.php

-
message: "#^Call to an undefined method Mage_Core_Helper_Abstract\\:\\:getNamePrefixOptions\\(\\)\\.$#"
count: 1
Expand Down Expand Up @@ -4505,11 +4500,6 @@ parameters:
count: 2
path: ../app/code/core/Mage/Dataflow/Model/Profile.php

-
message: "#^Call to an undefined method Mage_Core_Helper_Abstract\\:\\:getRegionJson\\(\\)\\.$#"
count: 1
path: ../app/code/core/Mage/Directory/Block/Adminhtml/Frontend/Region/Updater.php

-
message: "#^Cannot call method addCountryFilter\\(\\) on Mage_Core_Model_Resource_Db_Collection_Abstract\\|false\\.$#"
count: 2
Expand Down Expand Up @@ -7335,11 +7325,6 @@ parameters:
count: 1
path: ../app/code/core/Mage/Tag/Model/Tag/Relation.php

-
message: "#^Call to an undefined method Mage_Core_Helper_Abstract\\:\\:getRegionJson\\(\\)\\.$#"
count: 1
path: ../app/code/core/Mage/Tax/Block/Adminhtml/Frontend/Region/Updater.php

-
message: "#^Call to an undefined method Mage_Core_Helper_Abstract\\:\\:validateCatalogPricesAndFptConfiguration\\(\\)\\.$#"
count: 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ public function __construct(array $args = array())
public function render(Varien_Data_Form_Element_Abstract $element)
{
$country = $element->getForm()->getElement('country_id');
if (!is_null($country)) {
$countryId = $country->getValue();
} else {
if (is_null($country)) {
return $element->getDefaultHtml();
}

Expand All @@ -84,7 +82,7 @@ public function render(Varien_Data_Form_Element_Abstract $element)
$html .= '<script type="text/javascript">' . "\n";
$html .= '$("' . $selectId . '").setAttribute("defaultValue", "' . $regionId.'");' . "\n";
$html .= 'new regionUpdater("' . $country->getHtmlId() . '", "' . $element->getHtmlId() . '", "' .
$selectId . '", ' . $this->helper('directory')->getRegionJsonByStore($quoteStoreId).');' . "\n";
$selectId . '", ' . Mage::helper('directory')->getRegionJsonByStore($quoteStoreId).');' . "\n";
$html .= '</script>' . "\n";

$html .= '</td></tr>' . "\n";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Mage_Directory_Block_Adminhtml_Frontend_Region_Updater extends Mage_Adminh
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$html = parent::_getElementHtml($element);
$html .= "<script type=\"text/javascript\">var updater = new RegionUpdater('tax_defaults_country', 'tax_region', 'tax_defaults_region', ".$this->helper('directory')->getRegionJson().", 'disable');</script>";
$html .= "<script type=\"text/javascript\">var updater = new RegionUpdater('tax_defaults_country', 'tax_region', 'tax_defaults_region', ".Mage::helper('directory')->getRegionJsonByStore().", 'disable');</script>";

return $html;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
}
</script>';

$html .= sprintf($js, $this->helper('directory')->getRegionJson());
$html .= sprintf($js, Mage::helper('directory')->getRegionJsonByStore());
return $html;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
</div>
<?php echo $this->getChildHtml('form_after');?>
<script type="text/javascript">
var updater = new RegionUpdater('tax_country_id', 'tax_region', 'tax_region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, 'disable');
var updater = new RegionUpdater('tax_country_id', 'tax_region', 'tax_region_id', <?php echo Mage::helper('directory')->getRegionJsonByStore() ?>, 'disable');
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
$(data.prefix + '_weee_tax_row_'+data.index+'_country').value = data.country;
$(data.prefix + '_weee_tax_row_'+data.index+'_website').value = data.website_id;

updater = new RegionUpdater(data.prefix + '_weee_tax_row_'+data.index+'_country', null, data.prefix + '_weee_tax_row_'+data.index+'_state', <?php echo $this->helper('directory')->getRegionJson() ?>, 'disable', true);
updater = new RegionUpdater(data.prefix + '_weee_tax_row_'+data.index+'_country', null, data.prefix + '_weee_tax_row_'+data.index+'_state', <?php echo Mage::helper('directory')->getRegionJsonByStore() ?>, 'disable', true);
updater.update();

$(data.prefix + '_weee_tax_row_'+data.index+'_state').value = data.state;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
</form>
<script type="text/javascript">
//<![CDATA[
new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>);
new RegionUpdater('country', 'region', 'region_id', <?php echo Mage::helper('directory')->getRegionJsonByStore() ?>);
//]]>
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,6 @@
//billingForm.setElementsRelation('billing:country_id', 'billing:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
$('billing-address-select') && billing.newAddress(!$('billing-address-select').value);

var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'billing:postcode');
var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', <?php echo Mage::helper('directory')->getRegionJsonByStore() ?>, undefined, 'billing:postcode');
//]]>
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,6 @@
//shippingForm.setElementsRelation('shipping:country_id', 'shipping:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo Mage::helper('core')->jsQuoteEscape($this->__('Select State/Province...')) ?>');
$('shipping-address-select') && shipping.newAddress(!$('shipping-address-select').value);

var shippingRegionUpdater = new RegionUpdater('shipping:country_id', 'shipping:region', 'shipping:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'shipping:postcode');
var shippingRegionUpdater = new RegionUpdater('shipping:country_id', 'shipping:region', 'shipping:region_id', <?php echo Mage::helper('directory')->getRegionJsonByStore() ?>, undefined, 'shipping:postcode');
//]]>
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,6 @@
<script type="text/javascript">
//<![CDATA[
var dataForm = new VarienForm('form-validate', true);
new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'zip');
new RegionUpdater('country', 'region', 'region_id', <?php echo Mage::helper('directory')->getRegionJsonByStore() ?>, undefined, 'zip');
//]]>
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>
<script type="text/javascript">countryRegions = <?php echo $this->helper('directory')->getRegionJson() ?></script>
<script type="text/javascript">countryRegions = <?php echo Mage::helper('directory')->getRegionJsonByStore() ?></script>

<div class="page-title">
<h1><?php if($data->getAddressId()): ?><?php echo $this->__('Edit Address Entry') ?><?php else: ?><?php echo $this->__('New Address Entry') ?><?php endif ?></h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
//<![CDATA[
var dataForm = new VarienForm('form-validate', true);
<?php if($this->getShowAddressFields()): ?>
new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'zip');
new RegionUpdater('country', 'region', 'region_id', <?php echo Mage::helper('directory')->getRegionJsonByStore() ?>, undefined, 'zip');
<?php endif ?>
//]]>
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
//billingForm.setElementsRelation('billing:country_id', 'billing:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo Mage::helper('core')->jsQuoteEscape($this->__('Select State/Province...')) ?>');
$('billing-address-select') && billing.newAddress(!$('billing-address-select').value);

var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'billing:postcode');
var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', <?php echo Mage::helper('directory')->getRegionJsonByStore() ?>, undefined, 'billing:postcode');
if ($('onepage-guest-register-button')) {
Event.observe($('onepage-guest-register-button'), 'click', function(event) {
var billingRememberMe = $('co-billing-form').select('#remember-me-box');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
//<![CDATA[
var dataForm = new VarienForm('form-validate', true);
<?php if($this->getShowAddressFields()): ?>
new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'zip');
new RegionUpdater('country', 'region', 'region_id', <?php echo Mage::helper('directory')->getRegionJsonByStore() ?>, undefined, 'zip');
<?php endif ?>
//]]>
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ $shippingAddress = $this->getShippingAddress();
<?php echo $this->getMessagesBlock()->toHtml() ?>
<script type="text/javascript">
//<![CDATA[
var countryRegions = <?php echo $this->helper('directory')->getRegionJson() ?>
var countryRegions = <?php echo Mage::helper('directory')->getRegionJsonByStore() ?>
//]]>
</script>
<div class="paypal-review-order">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
</form>
<script type="text/javascript">
//<![CDATA[
new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>);
new RegionUpdater('country', 'region', 'region_id', <?php echo Mage::helper('directory')->getRegionJsonByStore() ?>);
//]]>
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,6 @@
//shippingForm.setElementsRelation('shipping:country_id', 'shipping:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo Mage::helper('core')->jsQuoteEscape($this->__('Select State/Province...')) ?>');
$('shipping-address-select') && shipping.newAddress(!$('shipping-address-select').value);

var shippingRegionUpdater = new RegionUpdater('shipping:country_id', 'shipping:region', 'shipping:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'shipping:postcode');
var shippingRegionUpdater = new RegionUpdater('shipping:country_id', 'shipping:region', 'shipping:region_id', <?php echo Mage::helper('directory')->getRegionJsonByStore() ?>, undefined, 'shipping:postcode');
//]]>
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,6 @@
<script type="text/javascript">
//<![CDATA[
var dataForm = new VarienForm('form-validate', true);
new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'zip');
new RegionUpdater('country', 'region', 'region_id', <?php echo Mage::helper('directory')->getRegionJsonByStore() ?>, undefined, 'zip');
//]]>
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>
<script type="text/javascript">countryRegions = <?php echo $this->helper('directory')->getRegionJson() ?></script>
<script type="text/javascript">countryRegions = <?php echo Mage::helper('directory')->getRegionJsonByStore() ?></script>

<div class="page-title">
<h1><?php if($data->getAddressId()): ?><?php echo $this->__('Edit Address Entry') ?><?php else: ?><?php echo $this->__('New Address Entry') ?><?php endif ?></h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
</div>
<script type="text/javascript">
//<![CDATA[
var <?php echo $prefix ?>RegionUpdater = new RegionUpdater('<?php echo $prefix ?>:country_id', '<?php echo $prefix ?>:region', '<?php echo $prefix ?>:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, '<?php echo $prefix ?>:postcode');
var <?php echo $prefix ?>RegionUpdater = new RegionUpdater('<?php echo $prefix ?>:country_id', '<?php echo $prefix ?>:region', '<?php echo $prefix ?>:region_id', <?php echo Mage::helper('directory')->getRegionJsonByStore() ?>, undefined, '<?php echo $prefix ?>:postcode');
<?php echo $prefix ?>RegionUpdater.update();
//]]>
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
//billingForm.setElementsRelation('billing:country_id', 'billing:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->jsQuoteEscape($this->__('Select State/Province...')) ?>');
$('billing-address-select') && billing.newAddress(!$('billing-address-select').value);

var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'billing:postcode');
var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', <?php echo Mage::helper('directory')->getRegionJsonByStore() ?>, undefined, 'billing:postcode');
if ($('onepage-guest-register-button')) {
Event.observe($('onepage-guest-register-button'), 'click', function(event) {
var billingRememberMe = $('co-billing-form').select('#remember-me-box');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
//<![CDATA[
var dataForm = new VarienForm('form-validate', true);
<?php if($this->getShowAddressFields()): ?>
new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'zip');
new RegionUpdater('country', 'region', 'region_id', <?php echo Mage::helper('directory')->getRegionJsonByStore() ?>, undefined, 'zip');
<?php endif ?>
//]]>
</script>
Expand Down