So I am started to test my component on Joomla 4
After installation I cannot access System section anymore because of the fatal error:
Argument 1 passed to Joomla\CMS\Schema\ChangeSet::getUpdateQueries() must be of the type array, boolean given, called in /var/www/nnt.ncj4/public_html/libraries/src/Schema/ChangeSet.php on line 74
Additionally I have a warning:
JFolder: :files: Path is not a folder. Path: /var/www/nnt.ncj4/public_html/administrator/components/com_competition/sql/updates/mysql
Seems that I need to put my update SQLs under /sql/updates/mysql folder, because currently they are under /sql/updates.
But the question is - should it lead to fatal error and block the access to System section?
<install>
<sql>
<file driver="mysql" charset="utf8">sql/install.mysql.utf8.sql</file>
</sql>
</install>
<uninstall>
<sql>
<file driver="mysql" charset="utf8">sql/uninstall.mysql.utf8.sql</file>
</sql>
</uninstall>
<update>
<schemas>
<schemapath type="mysql">sql/updates</schemapath>
</schemas>
</update>
3 and 4. Well :) There a lot of work should be done ;)
Having the same issue too.
Messing around with some code and will hopefully submit a worthy PR
Status | New | ⇒ | Discussion |
Category | ⇒ | Code style |
Labels |
Added:
J4 Issue
|
Labels |
Added:
?
|
Category | Code style | ⇒ |
Is this still an issue?
Well :) I will check later. Need to install fresh 4.0 to test.
Labels |
Added:
Information Required
|
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-01-04 02:04:49 |
Closed_By | ⇒ | Quy |
Closing for now. You can comment here and we can re-open the issue.
I am back. No issue on the latest beta1-dev anymore
Oh the problems here are interesting...
Just looking at this bit of code tells me:
Core is trying to enforce a file path for SQL files; such a standardization does not exist and it should not be assumed the folder's presence actually means update deltas exist here
When parsing the XML manifest, the first
<schemapath>
element is used. This should retrieve the path for the correct database driver from the manifest. If whomever fixes this isn't copying the logic fromJoomla\CMS\Installer\Installer::parseSchemaUpdates()
(since core doesn't actually have a service layer for tasks like finding an extension's SQL schema files) then they're Doing It Wrong™.There's no check to say "hey, there isn't a directory here, we should abort the task", it's just assumed the directory will always exist.
Likewise, the
Joomla\CMS\Schema\ChangeSet
class just arbitrarily assumes the folder it's being given actually exists and that the search for files will always return an array (ignoring it can have a boolean return if the filesystem API has an error)