Declaration of Joomla\CMS\Uri\Uri::buildQuery(array $params) must be compatible with Joomla\Uri\AbstractUri::buildQuery($params)
Setup a local Joomla development environment
https://docs.joomla.org/J4.x:Setting_Up_Your_Local_Environment/
And you'll see the error:
Fatal error: Declaration of Joomla\CMS\Uri\Uri::buildQuery(array $params) must be compatible with Joomla\Uri\AbstractUri::buildQuery($params) in C:\YOURREPOSITORY\joomla-cms\libraries\src\Uri\Uri.php on line 290
One method has the array declaration, the other is indeed missing it. Adding array to Joomla\Uri\AbstractUri::buildQuery($params) in C:\YOURREPOSITORY\joomla-cms\libraries\vendor\joomla\uri\src\AbstractUri.php makes the line read protected static function buildQuery(array $params) and fixes the error.
Since this is the first time I'm setting up the Joomla repo for development I might do something wrong. I've followed the manual though and I installed it from scratch.
I've used the current latest Joomla 4.1-dev branch (commit 8b0b6c3)
| Labels |
Added:
No Code Attached Yet
|
||
When and where did you see the error which you reported?
After a fresh Joomla dev installation. Running XAMPP, but that shouldn't matter for this.
I've used the 4.1-dev branch on a fresh installation. I ran "composer install" and "npm ci". Called the URL in the browser which should show the installation screen, however it showed the error with the funky orange/red Joomla error background. After editing the declaration as mentioned above, I didn't encounter any issues.
I checked the code with PHPStorm which also flagged the incompatible declarations. I suppose the declaration buildQuery($params) of joomla-cms\libraries\vendor\joomla\uri\src\AbstractUri.php is out of date or not edited properly?
Which PHP version are you using?
| | Setting | | Value |
|---|---|
| | PHP Built On | | Windows NT MYPC 10.0 build 19044 (Windows 10) AMD64 |
| | Database Type | | mysql |
| | Database Version | | 10.4.22-MariaDB |
| | Database Collation | | utf8mb4_general_ci |
| | Database Connection Collation | | utf8mb4_general_ci |
| | Database Connection Encryption | | None |
| | Database Server Supports Connection Encryption | | No |
| | PHP Version | | 8.1.2 |
| | Web Server | | Apache/2.4.52 (Win64) OpenSSL/1.1.1m PHP/8.1.2 |
| | WebServer to PHP Interface | | apache2handler |
| | Joomla! Version | | Joomla! 4.1.0 Stable [ Kuamini ] 15-February-2022 09:30 GMT |
| | User Agent | | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36 |
Regardless of PHP version I don't think the declarations should differ?
/edit
This patch version is of another patch currently, but I used the latest 4.1-dev version.
Sure, I just did the following:
joomla-cms folder.https://github.com/joomla/joomla-cms into the folder using Sourcetree (4.1-dev branch)composer installnpm cilocalhost/joomla-cms in Chrome.Now it just works fine without the need to edit anything. Maybe something went wrong after my initial setup. The first time I was struggling with setting up composer and enabling ldap and g2 which I needed to enable manually. Maybe that caused it. So unless somebody else has this issue, I think it can be closed. Thanks for your help, @richard67!
| Status | New | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-03-17 17:44:11 |
| Closed_By | ⇒ | toroworx |
@toroworx So you did first close the repository, then checkout the 4.1-dev branch (the document still says the 4.0-dev branch because that's a bit outdated), then run "composer install" and then "npm ci" and then made a new installation of Joomla by calling the URL in the browser so that the installation form is shown?
When and where did you see the error which you reported?