changed export user presets emgine
Details
Plan for an upgrade
- Install 5.2.2-B1 version
- Login as administrative user to the adm.console
- Go to E-Commerce → Orders section, Search tab
- Press Export button it the toolbar
- Move first 7 fields from "Available Columns" to "Export Columns"
- Check "Save/Update Export Preset" checkbox
- Input "7 fields" in the "Export Preset Title" field
- Input "test" in the "Export Filename" field
- Press "Save" button in toolbar
- Close "Orders Export" window
- Press Export button it the toolbar, confirm that "7 fields" preset exists in the "Export Preset" dropdown
- Upgrade to 5.2.2-B3 version
- Login as administrative user to the adm.console
- Go to E-Commerce → Orders section, Search tab
- Press Export button it the toolbar, confirm that "7 fields" preset exists in the "Export Preset" dropdown
- Select "7 fields" preset exists in the "Export Preset" dropdown
- Press "Delete" button
- Close "Orders Export" window
- Press Export button it the toolbar, confirm that "7 fields" preset is removed from "Export Preset" dropdown
Plan for a clean install
- Install 5.2.2-B3 version
- Login as administrative user to the adm.console
- Go to E-Commerce → Orders section, Search tab
- Press Export button it the toolbar
- Move first 7 fields from "Available Columns" to "Export Columns"
- Check "Save/Update Export Preset" checkbox
- Input "7 fields" in the "Export Preset Title" field
- Input "test" in the "Export Filename" field
- Press "Save" button in toolbar
- Close "Orders Export" window
- Press Export button it the toolbar, confirm that "7 fields" preset exists in the "Export Preset" dropdown
- Testing removal:
- select export preset
- press delete button next to preset name
- confirm, the removal in the dialog that is shown
- confirm, that preset was removed
- close "Orders Export" window
- press Export button it the toolbar
- confirm, that previously removed preset is absent
Plan for a reinstall
- open .../core/install.php URL in the web browser (the "..." is replaced with In-Portal base URL)
- select Reinstall In-Portal option and type user/password of the root user
- press Continue button
- proceed until you've reached Step 5 - Database Configuration step
- confirm, that all In-Portal related tables from the database were removed
Diff Detail
- Repository
- rINP In-Portal
- Branch
- /in-portal/branches/5.2.x
- Lint
Lint Errors Excuse: fixing all files is not part of this task Severity Location Code Message Error core/install/upgrades.php:2457 PHPCS.E.CodingStandard.Classes.ClassDeclaration.SpaceBeforeCloseBrace CodingStandard.Classes.ClassDeclaration.SpaceBeforeCloseBrace Error core/kernel/db/db_event_handler.php:135 PHPCS.E.CodingStandard.Arrays.Array.SpaceAfterKeyword CodingStandard.Arrays.Array.SpaceAfterKeyword Error core/kernel/db/db_event_handler.php:135 PHPCS.E.Generic.PHP.LowerCaseKeyword.Found Generic.PHP.LowerCaseKeyword.Found - Unit
No Unit Test Coverage - Build Status
Buildable 1071 Build 1071: arc lint + arc unit
Event Timeline
core/install/install_schema.sql | ||
---|---|---|
1435 | delete | |
1440 | make this a primary key instead of the Id column usage of REPLACE SQL in this table will result in a constant Id field increase | |
1441 | delete | |
core/install/upgrades.php | ||
2375–2403 |
this is also a 3rd mode and we need migration to be executed only once during an upgrade | |
modules/in-commerce/admin_templates/orders/export/export.tpl | ||
110 | Is the code populating/using the delete_preset_name hidden field needed at all? I've noticed, that the OnDeleteExportPreset event should get all form data anyway and can extract chosen export user preset name from there. | |
110–111 | add condition to prevent removal of 1st option, which is empty in 100% cases | |
111–121 | if presets.remove(i); does the same, then use it instead |
core/install/install_schema.sql | ||
---|---|---|
1440 | Also reduce the length of columns used in the index (pick the length you think will work best considering possible data in these columns), because currently, this SQL ends with an error: ERROR: Specified key was too long; max key length is 1000 bytes |
core/kernel/db/db_event_handler.php | ||
---|---|---|
3083–3084 | Please replace with: $delete_preset_name = $this->Application->GetVar('delete_preset_name'); if ( !$delete_preset_name ) { return; } | |
3093 | Please replace with: 'PresetName = ' . $this->Conn->qstr($delete_preset_name), | |
modules/in-commerce/admin_templates/orders/export/export.tpl | ||
99–100 | delete this | |
109–126 | Replace this with jQuery $.post code: $.post( '<inp2:m_Link template="index" no_amp="1" js_escape="1"/>', { 'events[ord.export]': 'OnDeleteExportPreset', delete_preset_name: delete_preset_name }, function () { presets = document.getElementById('<inp2:ord.export_InputName field="ExportPresets"/>'); for ( var i = 0; i < presets.options.length; i++ ) { if ( presets.options[i].selected ) { presets.options[i].remove(); } } presets.options[0].selected = true; } ); | |
110 | False alarm. My apologies. While testing the code I figured out why this was needed. | |
110–111 | ignore this I see, that added condition at the method beginning already covers this. | |
111–121 | ignore this The PhpStorm doesn't like this code, so I guess it won't work as well. |
Changed install schema due Jenkins message - all primary key fields must be without null values
The 15. Press Export button it the toolbar, confirm that "7 fields" preset exists in the "Export Preset" dropdown step fails for me with this SQL error in the export popup:
RuntimeException: Table 'alex_inportal_upgrade.51x_ExportUserPresets' doesn't exist (1146) SQL: SELECT PresetData, PresetName FROM 51x_ExportUserPresets WHERE (ItemPrefix = 'ord') AND (PortalUserId = 1) in ...\core\kernel\utility\logger.php on line 916