7
votes
Loading the built-in jQuery in Joomla 4 if it does not exist
You should be able to load it like so:
Joomla\CMS\HTML\HTMLHelper::_('jquery.framework');
Else, if you're using Joomla's Web Asset Manager, then you can define it as a dependency in your JSON object:
...
5
votes
Accepted
How to use joomla.asset.json correctly?
To your first question "how can I make Joomla acknowledge my joomla.asset.json changes without reinstalling extensions?"
I think it is not right that you have to reinstall the extension ...
5
votes
Accepted
What is the best way for raising an error message in Joomla 4
In #1 the first line of the first method will output a message to the next page that is displayed to user after the processing has completed so this is a nice simple way to inform that user that they ...
4
votes
SQL syntax error in query with subquery using JDatabase
to spot a sql syntax error it's useful to view the resultant sql eg.
echo $query->__toString();
you've put the alias of the subquery 'b' as the alias of the table inside the subquery. But the ...
3
votes
Accepted
In controller in admin of my component, i want to load a model from com_plugins
Yes, Joomla4 has a different approach.
This is how you can call other component's Model:
use Joomla\CMS\Factory;
$app = Factory::getApplication();
$model = $app->bootComponent('com_plugins')->...
3
votes
Install Script - J3 to J4
Q1 - In J4 I found that this simple function gets what you might want:
/**
* Get the version of the component
* @return version element of manifest
*/
public static function getComponentVersion()
{
...
3
votes
Accepted
Is there a resource showing all the J3 classes mapped to the J4 equivalents?
You can find the equivalent of Joomla! classes here:
https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/classmap.php
Your IDE will show when a method is deprecated in your code if you set ...
3
votes
Accepted
Send error or exception returned from ajax request to enqueuemessage
When you say "display it into enqueuemessage" I'm assuming that you want to display it in the same message area that enqueueMessage displays in. You can do that in your javascript by calling Joomla....
3
votes
Accepted
Joomla 4 alpha - link to dialog file in editor-xtd broken
You should try to define the path with using Constants:
$button->set('link', JPATH_ROOT . '/plugins/editors-xtd/insertmystuff/insert_mystuff/mystuffplugin_dialog.php?e_name=' . $name);
or:
$...
3
votes
Accepted
How to override a form field in Joomla 4
Apparently, you need to use namespaces in your extension to override fields with the same type. This is because of the class lookup order:
Namespaces added using addfieldprefix attribute or
Joomla\...
3
votes
Joomla 4 no longer inserting the Itemid, the current or active menu , in the URL. Is this correct behavior?
In Joomla 4 the /library/src/Router/SiteRouter.php has a new method, buildInit, that replaces the createInit method of Joomla 3. In appearance they do the same thing, suffix the URL with the Itemid=(...
3
votes
Accepted
J4 - Custom Profile Plugin - Hiding Groups
I don't think it's safe to remove field groups based on fieldset names. They are unrelated and could be named differently, leading to unexpected results. And that is exactly the issue you're running ...
3
votes
Accepted
SQL syntax error in query with subquery using JDatabase
You can actual fetch the desired result without implementing a JOIN on a subquery.
Use a LEFT JOIN if you want the possibility of zero counts in the results. Use a regular JOIN (INNER JOIN) if you ...
3
votes
Accepted
language file naming conventions
Use non-prefixed filenames in J4 (3.10 also supports this). Nothing is stripping the prefix, some core manifest files just haven't been updated.
3
votes
New files in Joomla 4 components
An excellent resource for Joomla 4 extension development is "Joomla 4.x Tutorial - Extension Development - The Way to Joomla 4 Extensions" written by Astrid Günther: https://blog.astrid-...
3
votes
Accepted
New files in Joomla 4 components
services/provider.php should return a service provider which is used to register services with the service container and set up initial dependencies. This is the only file with a hardcoded filename ...
2
votes
Accepted
How to add category name to url path for an article in Joomla 4?
With Joomla core you need to setup a menu structure that will correspond to what you want to achieve with your URLs. Menus are important in Joomla.
From the example of the URLs in your question - it ...
2
votes
Accepted
Updating JEventDispatcher triggers
use Joomla\CMS\Factory;
Factory::getApplication()->triggerEvent('onBeforeRenderToolbar', array($settings));
This method can be used in 3.x too.
2
votes
architecture diagram (current 3.x, 4.x) of joomla architecture
Unfortunately there is nothing like this for Joomla 4 yet. With all the amount of work that's gone into it, there's not a major amount of documentation yet.
You can however use some other resources ...
2
votes
Accepted
Getting Error "Call to undefined method Joomla\CMS\Editor\Editor::getContent"
As it is explained in core.js: instead of using getContent() method you should use:
To get the current editor value:
Joomla.editors.instances['jform_articletext'].getValue();
Where ...
2
votes
Accepted
Install component run code in postflight
Since you kindly provided the link to the source files, I have downloaded your full Kunena package (6.0 dev.) (for Joomla 4.x.x dev.) just to give it a try and my short conclusion is the following: (...
2
votes
Accepted
Where to read about Joomla 4 convention for class names
Components in J4 use a service-based approach which, in theory, should allow any naming convention. Although for that you'd have to write your own factories.
But if you want to follow same conventions ...
2
votes
Accepted
Model not found when from a controller
MycomponentController class is missing the class prefix. It should be -
namespace Example\Mycomponent\Libraries\Controller;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\MVC\Factory\...
2
votes
Accepted
Is the word Proxy a reserved word (J4)
J4 uses inflector library to pluralize list view names based on form view name. J3 also does something similar, but it's much more limited. One solution would be to use correct plural name for your ...
2
votes
Accepted
Add Custom Admin Button in component - Joomla4
With a fresh mind this morning, I thought I'd try the old J3 way using the ToolbarHelper and problem solved.
ToolbarHelper::custom('mycontroller.processData', 'process.png', 'process_f2.png', '...
2
votes
Accepted
Joomla 4 - Module Backend Subform subform-row-add "row" not available
The way the event is invoked is slightly different for Joomla 4.
You can use the following:
$(document).on('subform-row-add', function(event) {
console.log(event.detail.row);
});
Or native ES6+ ...
2
votes
Accepted
Joomla don't see subgroups in the Articles tab (Joomla 4)
Please note the difference between "user groups" and "access levels".
Access Levels determine which users have access to certain views and features.
Said levels are assigned to ...
2
votes
Accepted
Joomla 4. Call to a member function getTable() on bool
The solution has been found. My controller contained a __construct() function of this type:
class MyviewnameController extends FormController
{
function __construct( $config = array() )
{
...
2
votes
Accepted
Deleting user account when user has published articles
All the records in the Joomla database that have created_by or modified_by fields will have the same issue when you delete users in Joomla's User Manager.
I don't think that removing users will break ...
2
votes
Accepted
Decode json strings from a database table column
It looks like you are mangling valid json data with explode() (the wrong tool for the job).
You just need to call json_decode() on each string. This can be done with array_map() or a classic foreach()...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
joomla-4 × 90joomla-4.x × 20
php × 7
extensions × 6
custom-component × 6
custom-field × 6
articles × 5
mysql × 5
javascript × 5
administrator × 5
joomla-3.x × 4
component × 4
router × 4
namespace × 4
plugin × 3
user × 3
joomla-api × 3
jdatabase × 3
templates × 2
login × 2
url × 2
category × 2
editor × 2
php7 × 2
modal × 2