Page MenuHomeIn-Portal Phabricator

INP-1781 - Respect sub-item status, when performing unique validation
ClosedPublic

Authored by alex on Feb 19 2020, 11:09 AM.

Details

Test Plan
  1. in IDE:
    • open modules/in-bulletin/units/poll_answers/poll_answers_config.php file for editing
    • add 'unique' => array('PollId'), to Answer field declaration
    • save changes
    • open modules/in-bulletin/units/polls/polls_config.php file for editing
    • add 'unique' => array(), to Name field declaration
    • save changes
  2. in Admin Console:
    • go to Website & ContentPolls section
    • create 3 polls with 2 answers in each of them (answer text must be unique within same poll)
    • open 2 polls for editing
    • delete any answer in any of edited polls, but remember answer text (that is unique)
    • attempt to create new answer with that (remembered) text
    • confirm, that record is created
    • create another poll with name matching existing poll
    • confirm, that validation error will be triggered

Diff Detail

Repository
rINP In-Portal
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

alex created this revision.Feb 19 2020, 11:09 AM
alex requested review of this revision.Feb 19 2020, 11:09 AM
alex edited the test plan for this revision. (Show Details)Feb 19 2020, 11:11 AM
alex added a project: Restricted Project.
erik accepted this revision.Feb 19 2020, 11:47 AM
This revision is now accepted and ready to land.Feb 19 2020, 11:47 AM
alex planned changes to this revision.Mar 18 2020, 4:22 AM

Detected an issue (SQL error), when validation of sub-item happens to before parent item is saved into the database.

alex updated this revision to Diff 929.Mar 18 2020, 4:45 AM

Don't perform unique validation from TEMP to LIVE table, when parent record isn't yet created in TEMP table.

This revision is now accepted and ready to land.Mar 18 2020, 4:45 AM
alex requested review of this revision.Mar 18 2020, 4:52 AM

Please test again. Also update test plan to include testing of added code fragment: http://qa.in-portal.org/D379?vs=927&id=929#toc .

erik accepted this revision.Mar 26 2020, 6:12 AM
This revision is now accepted and ready to land.Mar 26 2020, 6:12 AM
This revision was automatically updated to reflect the committed changes.