Page MenuHomeIn-Portal Phabricator

INP-1547 Create "promo-block:ImageField" tag
ClosedPublic

Authored by erik on Mar 23 2016, 5:52 AM.

Details

Summary

Added requested tag.

Test Plan
  1. login to Admin Console
  2. go to ConfigurationWebsiteRegional section
  3. create second language
  4. go to ToolsQuery Database section
  5. run SQL like ALTER TABLE inp_PromoBlocks ADD l1_SecondImage VARCHAR(255) NOT NULL DEFAULT "", ADD l2_SecondImage VARCHAR(255) NOT NULL DEFAULT "" (replace inp_ with your table prefix)
  6. add test code line $fields['l' . $lang_id . '_SecondImage'] = $a_image; to promo-block:OnAfterConfigRead event after "$fields['l' . $lang_id . '_Image'] = $a_image;" line
  7. add test code <inp2:promo-block_ImageField/><br /><inp2:promo-block_ImageField name='SecondImage'/> to promo_blocks/promo_block_edit template
  8. add test code line <inp2:m_RenderElement name="inp_edit_swf_upload" caption_render_as="multilang_field_caption_element" prefix="promo-block" field="l{$langId}_SecondImage" title="la_fld_SecondImage"/> to promo_blocks/promo_block_edit template after <inp2:m_RenderElement name="inp_edit_swf_upload" caption_render_as="multilang_field_caption_element" prefix="promo-block" field="l{$langId}_Image" title="la_fld_Image"/> line
  9. go to Website & ContentPromo BlocksDefault Group section
  10. add promo block with primary language images only
  11. open just added promo block on edit
  12. confirm that file names, displayed by test tags, are related to primary language
  13. select another language in the top right corner of the promo block edit form
  14. confirm that file names, displayed by test tags, are related to primary language
  15. add images for secondary language and save
  16. open just edited promo block on edit
  17. confirm that file names, displayed by test tags, are related to currently selected language
  18. select another language in the top right corner of the promo block edit form
  19. confirm that form refreshes and file names, displayed by test tags, are related to just selected language

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

erik updated this revision to Diff 506.Mar 23 2016, 5:52 AM
erik retitled this revision from to INP-1547 Create "promo-block:ImageField" tag.
erik updated this object.
erik edited the test plan for this revision. (Show Details)
erik added a reviewer: alex.
erik added 1 JIRA issue(s): INP-1547.
alex requested changes to this revision.Mar 23 2016, 6:14 AM
alex edited the test plan for this revision. (Show Details)
alex edited edge metadata.
alex added inline comments.
core/units/promo_blocks/promo_block_tp.php
103–105 ↗(On Diff #506)

This code isn't covered by test plan at all. To test it you actually need to:

  1. create 2nd image field for a promo block (same field options as for current Image field)
  2. show it on promo block editing page to allow user upload to it
  3. call new tag with name or field parameters pointing to that field
114–120 ↗(On Diff #506)

This, according to plan from task, should:

  1. take value from current language, when available
  2. take value from primary language otherwise

Such behavior is also not covered by test plan, where currently image on all languages is uploaded.

This revision now requires changes to proceed.Mar 23 2016, 6:15 AM
erik edited the test plan for this revision. (Show Details)Mar 24 2016, 5:35 AM
erik edited edge metadata.
erik updated this revision to Diff 507.Mar 24 2016, 5:36 AM
erik edited edge metadata.
erik edited the test plan for this revision. (Show Details)

Made fallback to deafult language when corrent langiage field is empty.

erik edited the test plan for this revision. (Show Details)Mar 24 2016, 6:06 AM
erik edited edge metadata.
alex edited the test plan for this revision. (Show Details)Mar 24 2016, 6:10 AM
alex added a project: Restricted Project.Mar 26 2016, 6:44 AM
alex edited the test plan for this revision. (Show Details)Nov 20 2016, 11:46 AM
alex accepted this revision.Nov 20 2016, 11:59 AM
alex edited edge metadata.
This revision is now accepted and ready to land.Nov 20 2016, 11:59 AM
This revision was automatically updated to reflect the committed changes.