-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Not all install sql files are parsed if one is empty #17954
Description
Steps to reproduce the issue
In the extension manifest, in the install -> sql tag, add multiple file tags with sql scripts for parsing upon install. The first file specified, leave the contents of that file empty, then install the extension. Any files after that empty file aren't processed at all
Expected result
The next sql file is parsed, since an empty file can just be skipped, no need to abandon the whole parsing process
Actual result
The next sql files aren't processed
System information (as much as possible)
Joomla 3.7
Additional comments
Even when I put some comment line in the file, it still skipped the next files.
The cause seems to be in the file libraries/cms/installer/installer.php, on line 991 - 995. This checks if the file has any queries, and if none found, there is a 'return 0' on line 994, which breaks the entire process. This should be a 'continue', so the next file is parsed. Even if all the files come up empty, the variable $update_count is 0 anyway, so the end result of the function is still 0. So to fix this please change return 0; to continue; on line 994.