I have the importcsv module installed and the importcsv page loads fine. The file upload button appears when I load the url- https://web/importcsv
I upload a file, and the ajax “loading” text appears, however the ajax response turns out to be the entire layout of my site and the default importcsv upload page, rather that what I would assume is supposed to load in the importCsvFirstStepResult div (the “next step” fields), after the ajax request in download.js completes
...
onComplete : function(file, response) {
this.enable();
$("input#fileName").val(file);
$("div#importCsvFirstStepResult").html(response);
}
The /importcsv/default/upload ajax response apparently contains the wrong layout, failed to detect the request, or ???? and loads that default view into the response div, menus and all. I’m fairly new to Yii so maybe this is obvious someone out there.
Thanks for your assistance.
Solved my own problem. The ajax issue was due to me having tweaked (breaking) my urlManager rules. I changed the original rules to accomodate non-numeric primary keys on tables. For example the url to view a patient would be https://web/patients/view/ABC_1234 instead of https://web/patients/view/1234
I tend to use existing db schema where possible and the way my clients db schema is set up now, they’re using a non-numeric primary key. I wanted to continue this for certain reasons so I had to edit the url params becuase \d only matches digits. Unfortunately changing it to \w also matched some ajax requests and broke the whole thing.
Yii orginal rules. Works fine but doesn’t work for alphanumeric primary keys:
First I changed it to the following, to handle alphanumeric foreign keys, but this broke some ajax:
Finally arrived at the following, which allows ajax modules to function properly, and handles my non-numeric keys:
I ended up explicitly setting rules just for the controllers that need it. Most of them use integer primary keys
Hope this helps someone else. I was new to Yii and didn’t fully understand the rules and ajax system in Yii when I changed the rules.
Cheers