4

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 after every change in the file joomla.asset.json. It is only necessary the first time you add the joomla.asset.json file. So that Joomla registers this file. So ...


3

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\CMS\Form\FormHelper::addFieldPrefix() in reverse order. Joomla\CMS\Form\Field namespace. J-prefixed autoloaded classes. J-prefixed classes in directories added ...


3

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')->getMVCFactory()->createModel('Plugin', 'Administrator', ['ignore_request' => true]); or, the legacy way is also working about a year ago in Joomla4: ...


3

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() { $componentXML = Installer::parseXMLInstallFile(Path::clean(JPATH_ADMINISTRATOR . '/components/com_mycomponent/mycomponent.xml')); return $componentXML[...


3

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 as dependency the Joomla 4.0 git directory cloned locally. https://docs.joomla.org/Setting_up_your_workstation_for_Joomla_development#Installing_an_IDE_....


3

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.renderMessages(), which is a function in the Joomla core.js source file. The easiest way to get it to work is to use the JResponseJson class to handle the JSON ...


3

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: $button->set('link', JPATH_SITE . '/plugins/editors-xtd/insertmystuff/insert_mystuff/mystuffplugin_dialog.php?e_name=' . $name); You can also try with: $button-&...


3

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=(the value of the current/active menu item) to links on the page, however the logic has changed and it no longer handles a missing ItemId= correctly or at least ...


3

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 have an authorisation issue, it doesn't have to be a 403. You could do more processing and provide more meaningful messages that reflect the actual access issue....


3

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: { "name": "foobar", "type": "script", "uri": "com_mycomponent/script.min.js", "...


2

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 seems like you have created a menu item for the article1. If you want all articles of that category (cat1) to be reachable under the cat1/article1,art2,art3 ...


2

use Joomla\CMS\Factory; Factory::getApplication()->triggerEvent('onBeforeRenderToolbar', array($settings)); This method can be used in 3.x too.


2

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 to help: Potential backward compatibility issues in Joomla 4 Pull Requests for Joomla 4 Joomla 4 Docs That said, as far as I'm aware, I don't believe there are ...


2

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 jform_articletext means the textarea id and you have to change that value if your textarea id is something else. So in your case it could be for example: let ...


2

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: (well done for this extension, it looks good by the way!) As I wrote in my first comment I assumed that the problem is caused by the class name of the script ...


2

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 as Joomla core components, start by declaring a namespace in the component's manifest file. The namespace should be in this form: [Vendor]\Component\[Component ...


2

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\MVCFactoryInterface; class MycomponentController extends BaseController { public function __construct($config = [], MVCFactoryInterface $factory = null, $app ...


2

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 view. Another solution is to declare $view_list property in your form controller: class ProxyController extends FormController { protected $view_list = '...


2

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', 'COM_MYCOMPONENT_PROCESS_DATA', false); Later Edit: I've been trying to take more notice of the @deprecated 5.0 flags so thanks again @Carlitorweb. So it's only the ...


2

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+ Javascript (preferred): document.addEventListener('subform-row-add', ({ detail: { row } }) => { console.log(row); });


2

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 usergroups. Creating a child user group will inherit the access levels of the parent. The dropdown you see on the Articles page is a list of access levels, not ...


2

The solution has been found. My controller contained a __construct() function of this type: class MyviewnameController extends FormController { function __construct( $config = array() ) { $this->view_list = 'list'; parent::__construct( $config ); } } I looked at the com_content component controller and saw that now __construct(...


1

Use Joomla\CMS\User\UserFactory. You can get it from the service container: use Joomla\CMS\User\UserFactoryInterface; $userFactory = $container->get(UserFactoryInterface::class); Or using alias: $userFactory = $container->get('user.factory'); Where $container is the container. If you're doing this inside service provider file (services/provider.php),...


1

I've been adapting my custom J3 modules into J4 locally in a WAMP environment followed by installing them on a live test site. So far the only change I've had to make is adding the <namespace> to the module .xml files. These are simple extensions which display frontend content. Your mileage may vary depending on how complicated your modules are. Here ...


1

As far I am aware, feel free to correct me as I haven't played with Joomla 4 too much, the class naming conventions for controllers, models and views you need to use for Joomla to automatically resolve and load the related classes are the same as Joomla 3 and PSR/4 therefore your Controller and Model class name should be changed to class ...


1

Did you have a look at the Joomla code itself on Github too? https://github.com/joomla/joomla-cms/tree/4.0-dev When I take a look at the php files in the tmpl directories of components and modules I see the following setup for classNames. modules => mod-modulenmame components => com-componentname For instance com_contact. The className for a single ...


1

I found the answer finaly i greated an example on github for who is intrested: https://github.com/basd82/joomla_libarary


1

The solution to the above problem is to comment out the last section of the .htaccess file (See https://github.com/joomla/joomla-cms/issues/32892 and https://github.com/joomla/joomla-cms/pull/33097 for more details). I faced this issue because my LiteSpeed-based hosting server was already gzipping css and js files, so there was no need to gzip them again.


1

I found the above problem solved after using Helix Ultimate 2 Beta 2 Quickstart Package (https://github.com/JoomShaper/helix-ultimate/releases/download/v2.0.0-beta.2/helixultimate_2_beta2_quickstart.zip). Here are the steps that I followed: Download the Helix Ultimate Quickstart Package at https://github.com/JoomShaper/helix-ultimate/releases/tag/v2.0.0-...


1

The component id may not be available yet; you might be able to retrieve it from the db, I did find my own extension in the extensions table at this step but haven't tried; that seems overkill anyways. Just add the menu and submenu items in the xml of the component, in the administration section, at the same level as files and folders something like this: &...


Only top voted, non community-wiki answers of a minimum length are eligible