Skip to content

[Fix] Remove forgotten J6 deprecations#253

Merged
Elfangor93 merged 8 commits intoJoomGalleryfriends:masterfrom
Elfangor93:fix-install-J6
Sep 14, 2025
Merged

[Fix] Remove forgotten J6 deprecations#253
Elfangor93 merged 8 commits intoJoomGalleryfriends:masterfrom
Elfangor93:fix-install-J6

Conversation

@Elfangor93
Copy link
Member

This PR fixes the issue reported in #250

There were still some J6 deprecations in the code which made JoomGallery break in Joomla 6. This PR should remove this deprecations.

How to test this PR

Install the PR on a fresh Joomla 6 installations. Everything should work as you know it from within Joomla 5. No PHP errors.

@Elfangor93 Elfangor93 added needs testing This issue or pull request needs further testing GUI testing Tests can be perfomed using the GUI labels Jul 21, 2025
@MrMusic
Copy link
Member

MrMusic commented Jul 22, 2025

Try to install it on Joomla6:

0 Class "Path" not found 

Call Stack
# 	Function 	Location
1 	() 	JROOT\tmp\install_687f75ea2cd63\script.php:200
2 	com_joomgalleryInstallerScript->preflight() 	JROOT\libraries\src\Installer\LegacyInstallerScript.php:159
3 	Joomla\CMS\Installer\LegacyInstallerScript->__call() 	JROOT\libraries\src\Installer\LegacyInstallerScript.php:188
4 	Joomla\CMS\Installer\LegacyInstallerScript->callOnScript() 	JROOT\libraries\src\Installer\LegacyInstallerScript.php:99

after entering use \Joomla\Filesystem\Path; a new error appears:
Database not set in Joomla\CMS\Installer\Installer but no further information.
Maybe related: joomla/joomla-cms#45653

@MrMusic
Copy link
Member

MrMusic commented Aug 6, 2025

I applied the fix from here: joomla/joomla-cms#45670 and then tried to install again: The error Database not set in Joomla\CMS\Installer\Installer no longer appears.
The installation continues until the following error occurs:

0 Attempt to assign property "title" on null 

Call Stack
# 	Function 	Location
1 	() 	JROOT\tmp\install_68936f9d6f9b6\script.php:1563
2 	com_joomgalleryInstallerScript->createModule() 	JROOT\tmp\install_68936f9d6f9b6\script.php:282
3 	com_joomgalleryInstallerScript->install() 	JROOT\libraries\src\Installer\LegacyInstallerScript.php:159
4 	Joomla\CMS\Installer\LegacyInstallerScript->__call() 	JROOT\libraries\src\Installer\LegacyInstallerScript.php:188
5 	Joomla\CMS\Installer\LegacyInstallerScript->callOnScript() 	JROOT\libraries\src\Installer\LegacyInstallerScript.php:56 

@MrMusic
Copy link
Member

MrMusic commented Aug 10, 2025

Everything works well, except for one (hopefully the last) minor issue: The list of the 'Official JoomGallery extensions' in the Control Panel is empty.

@Elfangor93
Copy link
Member Author

The list of the 'Official JoomGallery extensions' in the Control Panel is empty.

Yes, this is expected. The extensions are not marked as compatible with Joomla 6. In order them to be listed, they need to have the corresponding joomla 6 flag in the update server.

@MrMusic
Copy link
Member

MrMusic commented Aug 11, 2025

The extensions are not marked as compatible with Joomla 6...

Ah, right. I had overlooked that.
I have tested this item ✅ successfully.
Thank you very much!

@MrMusic
Copy link
Member

MrMusic commented Aug 29, 2025

I applied the fix from here: joomla/joomla-cms#45670 and then tried to install again: The error Database not set in Joomla\CMS\Installer\Installer no longer appears.

It seems that the problem will not be fixed in the Joomla core. Would we then have to implement a workaround ourselves?

@MrMusic
Copy link
Member

MrMusic commented Sep 4, 2025

New error when installing with actual Joomla 6 Nightly:

0 Class "Joomgallery\Component\Joomgallery\Administrator\MVC\MVCFactoryProvider" not found 

Call Stack
# 	Function 	Location
1 	() 	JROOT\administrator\components\com_joomgallery\services\provider.php:50
2 	Joomla\DI\ServiceProviderInterface@anonymousC:\xampp83\htdocs\joomla6\administrator\components\com_joomgallery\services\provider.php:37$26cd->register() 	JROOT\libraries\src\Extension\ExtensionManagerTrait.php:145
3 	Joomla\CMS\Application\CMSApplication->loadExtension() 	JROOT\libraries\src\Extension\ExtensionManagerTrait.php:51
4 	Joomla\CMS\Application\CMSApplication->bootComponent() 	JROOT\plugins\behaviour\versionable\src\Extension\Versionable.php:110
5 	Joomla\Plugin\Behaviour\Versionable\Extension\Versionable->onTableAfterStore() 	JROOT\libraries\vendor\joomla\event\src\Dispatcher.php:454 

@Elfangor93
Copy link
Member Author

Elfangor93 commented Sep 6, 2025

@MrMusic The error is thrown by the Behaviour - Versionable Plugin, when the component tries to create the default category during installation. Since Joomla 6, the plugin loads the model using $model = $this->getApplication()->bootComponent($component)->getMVCFactory()->createModel($modelName, 'Administrator'); for no obvious reason.

One solution would be to deactivate the Plugin before installation. Another solution could be to remove the versioning completely from the JoomGallery component.

Related Joomla! cms issue:
joomla/joomla-cms#46040

@MrMusic
Copy link
Member

MrMusic commented Sep 7, 2025

One solution would be to deactivate the Plugin before installation. Another solution could be to remove the versioning completely from the JoomGallery component.

In that case, I would be in favour of removing the versioning.

@Elfangor93
Copy link
Member Author

I propose to merge this PR now and tackle the remaining issue in another PR. With this being merged, we can at least start testing JoomGallery with Joomla 6!. We just have to deactivate the Behaviour - Versionable Plugin for now.

I still would like to discuss the issue with the Joomla! maintainers before we fix something on our end.

@MrMusic
Copy link
Member

MrMusic commented Sep 10, 2025

Agreed. With the deactivated versionable plugin it works fine.

@Elfangor93 Elfangor93 merged commit 9bfec72 into JoomGalleryfriends:master Sep 14, 2025
1 check passed
@Elfangor93 Elfangor93 deleted the fix-install-J6 branch December 3, 2025 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GUI testing Tests can be perfomed using the GUI needs testing This issue or pull request needs further testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants