Skip to content

Conversation

@Denitz
Copy link
Contributor

@Denitz Denitz commented Dec 30, 2025

Summary of Changes

We have nice #__extensions.custom_data MEDIUMTEXT column to store custom extension data, but it's not available in Joomla get extension methods.

Example: currently, if a template stores any own data in #__extensions.custom_data, it can be only retrieved via separate SQL query.

It would be nice to be able to have access to custom_data via native $app->getTemplate(true)

I.e. YooTheme will be able to use this workaround to reduce extra SQL query per page load.

Same for components, menus and modules.

Testing Instructions

Install patch.

Actual result BEFORE applying this Pull Request

You can't get custom_data via $app->getTemplate(true) and other extension get methods:

var_dump(\Joomla\CMS\Component\ComponentHelper::getComponent('com_content'));
var_dump(\Joomla\CMS\Plugin\PluginHelper::getPlugin('authentication', 'joomla'));
var_dump(\Joomla\CMS\Helper\ModuleHelper::getModule('mod_menu'));
var_dump(\Joomla\CMS\Factory::getApplication()->getTemplate(true));

Expected result AFTER applying this Pull Request

You can get custom_data in all methods above.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@HLeithner
Copy link
Member

I did a quick look and it isn't loaded anywhere in the core, for example the ComponentHelper also doesn't load it. So I'm not so sure if it should be added at all. it's a field only for 3rd party extensions (based on the relevant github pr and issue) which also means it's in your space to use it as you need it.

If we load it we should be consistent and make it available in all get functions.

@Denitz Denitz changed the title [6.1] Provide #__extensions.custom_data with $app->getTemplate(true) [6.1] Provide #__extensions.custom_data for components, menus, modules and template styles Jan 7, 2026
@Denitz
Copy link
Contributor Author

Denitz commented Jan 7, 2026

@HLeithner I've updated the description and code to have custom_data for components, menus and modules consistently.

@HLeithner
Copy link
Member

thanks, now we need some testers.

@laoneo
Copy link
Member

laoneo commented Jan 7, 2026

@wilsonge can you have a look here?

@wilsonge
Copy link
Contributor

wilsonge commented Jan 7, 2026

I mean I'm ok with this i guess. Given we decided in #19348 that it was used by various extensions it makes sense to make it easily available in existing queries for them to use. Do we need a helper method in the InstallScript's to help extension dev's set it?

@HLeithner
Copy link
Member

at least not in this pr, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants