Skip to content

Update to admin marketplace/installer.php#14709

Merged
danielkerr merged 4 commits intoopencart:masterfrom
milsaware:master
Mar 22, 2025
Merged

Update to admin marketplace/installer.php#14709
danielkerr merged 4 commits intoopencart:masterfrom
milsaware:master

Conversation

@milsaware
Copy link
Copy Markdown
Contributor

I created an xml file and changed its extension to ocmod.zip and went to install. Thereafter, every time I attempted to load the extension installer page, I was greeted with a PHP unauthorised zip file error and the page just wouldn't load. This update checks for errors with the zip files, if there's an error it will delete the file and continue through the loop without crashing the page

I changed an xml file and changed its extension to ocmod.zip and went to install. Thereafter, every time I attempted to load the extension installer page, I was greeted with a PHP unauthorised zip file error and the page just wouldn't load. This update checks for errors with the zip files, if there's an error it will delete the file and continue through the loop without crashing the page
@stalker780
Copy link
Copy Markdown
Contributor

What for $ZIP_ERROR is declared? It is not used anywhere

@milsaware
Copy link
Copy Markdown
Contributor Author

Sorry, you're right. I was logging the error on the screen, then I wanted to portray the message to the user on the installer page, but I haven't figured out how to display the message yet - I deleted the print code, do you think I should remove $ZIP_ERROR as well?

@stalker780
Copy link
Copy Markdown
Contributor

stalker780 commented Mar 22, 2025

Well. Anyway your code is not finished and does nothing except silent deleting zip files. I do not think it should be merged. It does not fix anything. I would prefer to see an error in the log and my files preserved rather than deleted without explanation.

@milsaware
Copy link
Copy Markdown
Contributor Author

Well, it does do something. It got the installer page loading again and removes the offending file that crashes it. I agree the error needs to be logged, it's just setting up the warning in the admin panel after the fact - any suggestions?

Added extra fields for the English language requirements of the installer update
Added in the extra fields required for the French language options in the installer update
Moved the validation from the getList function to the upload function to prevent the file from being uploaded to the server and crashing the page if there's an error. It now also displays an error message, with English and French translations, to the end user if the file can't be uploaded,
@milsaware
Copy link
Copy Markdown
Contributor Author

Okay, I think I got it. I shifted it to the upload function, so it now checks the temporary file before storing it to the server. If there's an error that wasn't previously picked up, it'll display an error message to the end user during the upload process

@danielkerr danielkerr merged commit 6cf61cd into opencart:master Mar 22, 2025
@danielkerr
Copy link
Copy Markdown
Member

looks like this is requiried. could be loads of reasons the files go corrupt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants