Page MenuHomeIn-Portal Phabricator

INP-1917 - Validate "kOptionsFormatter::Parse" method values
Needs ReviewPublic

Authored by alex on Mon, Jul 14, 12:35 PM.

Details

Reviewers
erik
Test Plan

Part 1

  1. open the /core/units/helpers/cat_dbitem_export_helper.php file for editing
  2. comment out last IF (validation error removal) in the \kCatDBItemExportHelper::setFieldValue method
  3. save changes
  4. execute tests in the kOptionsFormatterTest test case
  5. login to the Admin Console
  6. go to the Website & ContentStructure & DataProducts section
  7. create a product
  8. select that product in the grid
  9. use Export menu item under the Tools toolbar button to export at least these product info columns:
    • SKU
    • Status
    • CategoryPath
    • l1_Name
    • ProductId
    • EditorsPick
  10. open an exported CSV file for editing
  11. change Status column value to any non-existing option (e.g. Non-Existing)
  12. go to the ToolsImport Data section
  13. import that modified CSV file
  14. go to the Website & ContentStructure & DataProducts section
  15. confirm that a new product wasn't created as a result of the CSV import
  16. go to the Logs & ReportsSystem Log section
  17. confirm, that:
    • there is a record about failed product creation due to the unknown_option validation error
    • it shows the wrong option title (from the CSV file)

Part 2

  1. login to the Admin Console
  2. go to the Website & ContentPolls section
  3. create a poll in Active status
  4. open that poll for editing
  5. in the poll unit config comment-out Active option
  6. in Admin Console try saving that poll
  7. confirm that you'll get a nice error back saying, that 1 option doesn't exist

Part 3

  1. locate all units that use kOptionsFormatter formatter
  2. for each unit:
    1. try adding a new record
    2. try editing and changing the above-added record
    3. confirm that the unknown_option validation error (introduced in this Differential Revision) isn't happening
    4. report back each unit where an error happened during correct usage and explain that usage

Diff Detail

Repository
rINP In-Portal
Branch
/in-portal/branches/5.2.x
Lint
Lint ErrorsExcuse: Unrelated
SeverityLocationCodeMessage
Errorcore/kernel/utility/formatters/options_formatter.php:166PHPCS.E.Squiz.Strings.DoubleQuoteUsage.ContainsVarSquiz.Strings.DoubleQuoteUsage.ContainsVar
Errorcore/kernel/utility/formatters/options_formatter.php:166PHPCS.E.Squiz.Strings.DoubleQuoteUsage.ContainsVarSquiz.Strings.DoubleQuoteUsage.ContainsVar
Errorcore/kernel/utility/validator.php:62PHPCS.E.CodingStandard.Formatting.ItemAssignment.MixedWhitespaceAfterCodingStandard.Formatting.ItemAssignment.MixedWhitespaceAfter
Errorcore/kernel/utility/validator.php:62PHPCS.E.CodingStandard.Formatting.ItemAssignment.MixedWhitespaceBeforeCodingStandard.Formatting.ItemAssignment.MixedWhitespaceBefore
Errorcore/kernel/utility/validator.php:62PHPCS.E.Squiz.WhiteSpace.OperatorSpacing.SpacingAfterSquiz.WhiteSpace.OperatorSpacing.SpacingAfter
Errorcore/kernel/utility/validator.php:63PHPCS.E.CodingStandard.Commenting.InlineComment.InvalidEndCharCodingStandard.Commenting.InlineComment.InvalidEndChar
Errorcore/kernel/utility/validator.php:63PHPCS.E.CodingStandard.Formatting.ItemAssignment.MixedWhitespaceAfterCodingStandard.Formatting.ItemAssignment.MixedWhitespaceAfter
Errorcore/kernel/utility/validator.php:63PHPCS.E.CodingStandard.Formatting.ItemAssignment.MixedWhitespaceBeforeCodingStandard.Formatting.ItemAssignment.MixedWhitespaceBefore
Errorcore/kernel/utility/validator.php:63PHPCS.E.CodingStandard.Formatting.SpaceOperator.SpacingBeforeCodingStandard.Formatting.SpaceOperator.SpacingBefore
Errorcore/kernel/utility/validator.php:63PHPCS.E.Squiz.WhiteSpace.OperatorSpacing.SpacingAfterSquiz.WhiteSpace.OperatorSpacing.SpacingAfter
Errorcore/tests/Unit/kernel/utility/formatters/kOptionsFormatterTest.php:4PHPCS.E.Squiz.Classes.ValidClassName.NotCamelCapsSquiz.Classes.ValidClassName.NotCamelCaps
Unit
No Unit Test Coverage
Build Status
Buildable 11099
Build 3799: arc lint + arc unit

Event Timeline

alex created this revision.Mon, Jul 14, 12:35 PM
alex requested review of this revision.Mon, Jul 14, 12:35 PM
alex updated this revision to Diff 1354.Mon, Jul 14, 12:39 PM

Added missing phrase.

alex edited the test plan for this revision. (Show Details)Mon, Jul 14, 12:43 PM
alex edited the test plan for this revision. (Show Details)Tue, Jul 15, 2:17 AM