afzafri / UiTM-Timetable-Generator

Fetch and generate Timetable for UiTM
https://uitmtimetable.skrin.xyz
MIT License
41 stars 25 forks source link

Unable to Export to Excel #35

Closed danishzharfan closed 1 year ago

danishzharfan commented 3 years ago

The error message that was sent is "There was an error when an Ajax request! HTTP Error Code :500" image

afzafri commented 2 years ago

Seems to be bug on Heroku? Permission issue? Can't reproduce on local

afzafri commented 1 year ago

@ADIBzTER Can you please help to check on server log if there's any error recorded? Can't reproduce on my local. thanks

adibzter commented 1 year ago

POST 500 677B 5ms Firefox 111 https://uitmtimetable.skrin.xyz/api.php?exportexcel

The only log I found regarding this issue

adibzter commented 1 year ago

@afzafri I found another one

"[Fri Mar 24 17:43:15.760125 2023] [php:error] [pid 20] [client 169.254.1.1:33419] PHP Fatal error:  Uncaught Error: Class "ZipArchive" not found in /var/www/html/modules/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php:210\nStack trace:\n#0 /var/www/html/modules/excel_module.php(49): PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx->save()\n#1 /var/www/html/api.php(55): Excel->exportExcel()\n#2 {main}\n  thrown in /var/www/html/modules/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php on line 210, referer: https://uitmtimetable.skrin.xyz/"

I think this caused by missing dependencies. Will try to look into the CI pipeline and fix it.

afzafri commented 1 year ago

I see, need to install the PHP zip extension. Nevermind this is not priority. Thanks

afzafri commented 1 year ago

Should be fixed in https://github.com/afzafri/UiTM-Timetable-Generator/commit/e203218c7dcd2c73a5e2018dde72618909b3add4 . Moved the Excel file read and write process to client side.

Need @ADIBzTER help to deploy latest update to server for testing. Thanks!

adibzter commented 1 year ago

Deployed and works properly!