N°9121 - CSV Import : The advanced mode option no longer works as bef…#863
N°9121 - CSV Import : The advanced mode option no longer works as bef…#863bdalsass wants to merge 2 commits intosupport/3.2from
Conversation
|
| Filename | Overview |
|---|---|
| pages/csvimport.php | Replaces full-page reload on advanced-mode toggle with AJAX calls; DoAdvanced() calls DoMapping() synchronously before the async UpdateClassesSelect() completes, creating a race condition where stale class/mapping data can be shown. |
| pages/ajax.csvimport.php | Adds new display_classes_select AJAX case that rebuilds the classes select via ImportHelper; parameter handling and sanitisation look correct. |
| sources/Application/Helper/ImportHelper.php | New helper class extracting GetClassesSelectUIBlock from csvimport.php into a reusable static method; is_null($iActionCode) is dead code since the parameter is typed as non-nullable int. |
| lib/composer/autoload_classmap.php | Registers ImportHelper in the Composer classmap; straightforward and correct. |
| lib/composer/autoload_static.php | Registers ImportHelper in the static autoloader; straightforward and correct. |
Sequence Diagram
sequenceDiagram
participant User
participant Browser as "Browser (csvimport.php)"
participant AjaxCSV as "ajax.csvimport.php"
participant ImportHelper
User->>Browser: "Toggle Advanced checkbox"
Browser->>Browser: "DoAdvanced()"
Browser->>AjaxCSV: "POST display_classes_select {class_name, advanced}"
AjaxCSV->>ImportHelper: "GetClassesSelectUIBlock(name, class, action, bAdvanced)"
ImportHelper-->>AjaxCSV: "Select UI block"
AjaxCSV-->>Browser: "Rendered select HTML"
Browser->>Browser: "replaceWith(data) — rebind change to DoMapping()"
Note over Browser: DoMapping() called immediately before replaceWith completes
Browser->>AjaxCSV: "POST display_mapping_form {class_name (possibly stale), advanced}"
AjaxCSV-->>Browser: "Mapping form HTML"
Browser->>Browser: "Update #mapping (may use stale class)"
Reviews (1): Last reviewed commit: "N°9121 - CSV Import : The advanced mode ..." | Re-trigger Greptile
|
Could you be a little more specific? "doesn't work as before" is not really helpful. |
As mentionned in the related ticket, iTop doesn't automaticly select id anymore (on Data Mapping stage) |
|
Thanks, I'm not able to see that related ticket (I already asked a few times for partners to also be able to see Bugs on the support portal). |
…ore.
Base information
Symptom (bug) / Objective (enhancement)
CSV import advanced button doen't works as before