Page MenuHomeIn-Portal Phabricator

INP-1843 - Cache results of the "kCountryStatesHelper::getCountryIso" method
ClosedPublic

Authored by alex on Jul 14 2023, 6:06 AM.

Details

Test Plan

In IDE:

  1. open /admin/index.php file for editing
  2. replace the $application->Run(); line with below code:
/** @var kCountryStatesHelper $country_state_helper */
$country_state_helper = $application->recallObject('CountryStatesHelper');
echo $country_state_helper->getCountryIso('USA') . ';';
echo $country_state_helper->getCountryIso('US', true) . ';';
echo $country_state_helper->getCountryIso('RUS') . ';';
echo $country_state_helper->getCountryIso('RU', true) . ';';
  1. save changes

In Admin Console:

  1. go to Admin Console
  2. confirm, that US;USA;RU;RUS; text is displayed
  3. confirm, that in Debugger contains one SQL statement from the CountryStates table
  4. reload the page
  5. confirm, that US;USA;RU;RUS; text is displayed
  6. confirm, that in Debugger contains no SQL statements from the CountryStates table

Diff Detail

Repository
rINP In-Portal
Branch
/in-portal/branches/5.2.x
Lint
Lint ErrorsExcuse: Not related.
SeverityLocationCodeMessage
Errorcore/units/helpers/country_states_helper.php:248PHPCS.E.CodingStandard.Classes.ClassDeclaration.SpaceBeforeCloseBraceCodingStandard.Classes.ClassDeclaration.SpaceBeforeCloseBrace
Unit
No Unit Test Coverage
Build Status
Buildable 1193
Build 1193: arc lint + arc unit

Event Timeline

alex created this revision.Jul 14 2023, 6:06 AM
alex requested review of this revision.Jul 14 2023, 6:06 AM
alex edited the test plan for this revision. (Show Details)Jul 14 2023, 6:11 AM
alex added a project: Restricted Project.
erik accepted this revision.Jul 21 2023, 10:42 AM
This revision is now accepted and ready to land.Jul 21 2023, 10:42 AM
This revision was landed with ongoing or failed builds.Nov 22 2023, 2:53 AM
This revision was automatically updated to reflect the committed changes.