Vox Populi(x) forum

Alexandria Book Library => Errori (Bugs) => Topic started by: richardh9935 on 05 January 2022, 00:05:16

Title: importexport.xml needs accept=".sql"
Post by: richardh9935 on 05 January 2022, 00:05:16
To migrate my v3.1.5 Abook data to my testing v4(beta) system, I exported using the MYSQL export. That worked fine.
The import failed because the import_file step could not accept the particular file I wanted to use.
To make the import succeed, I had to change line 26 of .../Administrator/components/com_abook/models/forms/importexport.xml to accept a file with a .sql type.

The block of code was:
      <field name="import_file"
                        type="file" accept="text/*"
                        label="COM_ABOOK_FIELD_PARAMS_EBOOK_LABEL"
                        description="COM_ABOOK_FIELD_PARAMS_EBOOK_DESC"

I changed it to:
      <field name="import_file"
                        type="file" accept=".sql"
                        label="COM_ABOOK_FIELD_PARAMS_EBOOK_LABEL"
                        description="COM_ABOOK_FIELD_PARAMS_EBOOK_DESC"

I confirmed that the v3.1.5 and the v4.0.0Beta versions of importexport.xml are the same.

I'm using Safari 15.2 on macOS 12.1.
Title: Re: importexport.xml needs accept=".sql"
Post by: federica on 05 January 2022, 10:33:41
Hi richardh9935,
thanks for your suggest. My browser (firefox on linux) allows to upload sql file as "text" mime type without problem. Probably Safari is more fussy
Due to the field is used to upload both .csv and .sql file it is better to set accept="text/*, *.sql"
I fixed the bug. You can download the updated version.