Page MenuHomeIn-Portal Phabricator
  • Changed Files
  • branches/5.2.x/core/kernel/db/dbitem.php

INP-1733 Remove ".tmp" sub-extension from sub-item uploaded files
ClosedPublic

Authored by erik on Feb 23 2018, 6:51 AM.

Details

Summary

all done by plan - replaced tmp ids

Test Plan

Preparations - make following changes in system files:

  1. in the /core/units/reviews/reviews_config.php file change ReviewText field declaration in Fields array into:
'type' => 'string', 'default' => null, 'required' => 1,
'formatter' => 'kUploadFormatter',
'file_types' => '*.*',
'upload_dir' => WRITEBALE_BASE . '/reviews/',
  1. in the /modules/in-commerce/admin_templates/products/review_edit.tpl file:
    • change form control for ReviewText field into inp_edit_swf_upload
    • and add swf-upload javascript:
<script src="js/swfobject.js" type="text/javascript"></script>
<script type="text/javascript" src="<inp2:m_Compress files='js/uploader/upload_manager.js|js/uploader/uploader.js'/>"></script>

Testing

  1. login into Admin Console as root user
  2. go to Website & ContentProducts section
  3. open new tangible product creation window
  4. fill-in required fields on General tab
  5. go to the Comments tab
  6. add a new comment
  7. confirm, that uploaded file, which filename is shown in Comment column has .tmp extension (not a bug, because <inp2:Field name="$field" format='display_name'/> tag should be used for displaying uploaded filename)
  8. save product
  9. open created product for editing
  10. go to Comments tab
  11. confirm, that Comment value in the Comments grid no longer have .tmp extension

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 created this revision.Feb 23 2018, 6:51 AM
erik edited the test plan for this revision. (Show Details)Feb 23 2018, 6:54 AM
alex requested changes to this revision.Feb 23 2018, 7:04 AM
alex added inline comments.
core/kernel/db/dbitem.php
1170–1171 ↗(On Diff #825)
  1. before doing $this->SetID($new_id); store $this->GetID() (old id) into $old_id variable
  2. use $old_id instead of 0

old id is hardcoded

This revision now requires changes to proceed.Feb 23 2018, 7:04 AM
alex edited the test plan for this revision. (Show Details)Feb 23 2018, 7:07 AM
erik updated this revision to Diff 826.Feb 23 2018, 7:58 AM
erik edited edge metadata.

Removed old Id hardcoding.

alex edited the test plan for this revision. (Show Details)Feb 26 2018, 3:12 AM
alex accepted this revision.Feb 26 2018, 3:22 AM
alex edited the test plan for this revision. (Show Details)
This revision is now accepted and ready to land.Feb 26 2018, 3:22 AM
This revision was automatically updated to reflect the committed changes.