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
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
core/install/install_schema.sql | ||
---|---|---|
1435 ↗ | (On Diff #1039) | delete |
1440 ↗ | (On Diff #1039) | 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 ↗ | (On Diff #1039) | delete |
core/install/upgrades.php | ||
2371–2399 ↗ | (On Diff #1039) |
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 | ||
113 ↗ | (On Diff #1039) | 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. |
123 ↗ | (On Diff #1039) | add condition to prevent removal of 1st option, which is empty in 100% cases |
124 ↗ | (On Diff #1039) | if presets.remove(i); does the same, then use it instead |
core/install/install_schema.sql | ||
---|---|---|
1440 ↗ | (On Diff #1039) | 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 | ||
---|---|---|
3084–3088 ↗ | (On Diff #1039) | Please replace with: $delete_preset_name = $this->Application->GetVar('delete_preset_name'); if ( !$delete_preset_name ) { return; } |
3093 ↗ | (On Diff #1039) | Please replace with: 'PresetName = ' . $this->Conn->qstr($delete_preset_name), |
modules/in-commerce/admin_templates/orders/export/export.tpl | ||
100–101 ↗ | (On Diff #1039) | delete this |
112–128 ↗ | (On Diff #1039) | 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; } ); |
113 ↗ | (On Diff #1039) | False alarm. My apologies. While testing the code I figured out why this was needed. |
123 ↗ | (On Diff #1039) | ignore this I see, that added condition at the method beginning already covers this. |
124 ↗ | (On Diff #1039) | 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