Page MenuHomeIn-Portal Phabricator

INP-1777 - Preserve non-existing selected options during record field value display
ClosedPublic

Authored by alex on Oct 17 2019, 7:58 AM.

Details

Test Plan

Preparations

  • in the IDE:
    1. open /modules/in-bulletin/admin_templates/polls/poll_edit.tpl file for editing
    2. add <inp2:m_RenderElement name="inp_label" prefix="poll" field="MultiOptionField" format=", "/> line after <inp2:m_RenderElement name="subsection" title="la_section_General"/> line
    3. save changes
    4. open /modules/in-bulletin/units/polls/polls_config.php file for editing
    5. add this fragment in the $config array:
'VirtualFields' => array(
    'MultiOptionField' => array(
        'type' => 'string',
        'formatter' => 'kOptionsFormatter',
        'options' => array(1 => 'Option 1', 3 => 'Option 3'), 'multiple' => 1,
        'default' => '|1|2|3|',
    ),
),
  1. save changes

Testing

  • in Admin Console
    1. login to the Admin Console
    2. go to Website & ContentPolls section
    3. press Add button on the toolbar
    4. confirm, that newly added field has Option 1, Option 3, 2 value
    5. press Cancel button on the toolbar
  • in IDE:
    1. open /modules/in-bulletin/units/polls/polls_config.php file for editing
    2. change default field option of MultiOptionField field to the |1|3|
    3. save changes
  • in Admin Console
    1. login to the Admin Console
    2. go to Website & ContentPolls section
    3. press Add button on the toolbar
    4. confirm, that newly added field has Option 1, Option 3 value
    5. press Cancel button on the toolbar

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.Oct 17 2019, 7:58 AM
alex requested review of this revision.Oct 17 2019, 7:58 AM
alex added a project: Restricted Project.Oct 17 2019, 7:59 AM
erik accepted this revision.Oct 17 2019, 12:07 PM
This revision is now accepted and ready to land.Oct 17 2019, 12:07 PM
This revision was automatically updated to reflect the committed changes.