Attempt to Install latest branch of Joomla after composer install
and npm install
Go to Joomla install process
Fatal error: Cannot use Joomla\CMS\Factory as Factory because the name is already in use in C:\xxx\joomla-cms\libraries\src\Document\HtmlDocument.php on line 18
PHP 7.1.20
Each Document class uses Joomla\CMS\Factory, Factory is already assigned to Joomla\CMS\Document\Factory.
I updated the use statement to use Joomla\CMS\Factory as FactoryCMS
and updated each reference to FactoryCMS in each of the Document classes which seems to fix it. I'm not sure if making this change has caused other side effects?
Labels |
Added:
?
|
Category | ⇒ | Repository |
Title |
|
Labels |
Added:
J4 Issue
|
Status | New | ⇒ | Information Required |
Can you still replicate this issue?
I am surprised that no one else has seen this as its a fatal error in the installer so there will be a lot of people who have run the installer
@brianteeman Just pulled latest branch and still getting the same error.
Fatal error: Cannot use Joomla\CMS\Factory as Factory because the name is already in use in C:\xampp\htdocs\joomla-cms\libraries\src\Document\HtmlDocument.php on line 14
As it is in the HtmlDocument class, I'm not sure if this is only related to the installer as this class is used for most rendering on the site? I just can't get past the installer at the moment to test this.
When I do my suggested solution it then complains of a similar issue but in the class Joomla\CMS\Document\Document. If I make the same fix in that class I can then see the installer setup but this then breaks when coming to installing the database. Upon inspection I am again getting the same error in Joomla\CMS\Document\JsonDocument. Every Document class that uses Joomla\CMS\Factory is having the conflict.
Exactly where/when do you get that error
I have done about twenty installs this morning and I didnt have any errors
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-08-13 10:33:14 |
Closed_By | ⇒ | wilsonge |
I know this is closed, but I just had the same error after installing the latest nightly build over a failed upgrade install. My error was in ErrorDocument.php. As a test I performed the same changes as above and got passed this problem, but then had another issue. Do you want a new issue raised for this or is there further activity already in progress? Cheers.
That's a good fix - can you make that as a pull request please?