Questions tagged [joomla-4.x]

For questions regarding version 4.x of the Joomla! Content Management System.

Filter by
Sorted by
Tagged with
7 votes
1 answer
120 views

Joomla extension update 3.x and 4.x

I have an update server for my extensions, which targets Joomla 3.8 and 3.9 <targetplatform name="joomla" version="3.[89]"/> With the release of Joomla 3.10 and 4.0 coming ...
user avatar
  • 26.5k
4 votes
4 answers
3k views

JFactory::getDbo() deprecated-- what's the replacement?

I'm running Joomla 3.9.5 and I'm attempting to update my JFactory::getDbo() calls (which are deprecated) to the newer format using the container. However, I'm getting the following error: Call to ...
user avatar
  • 1,089
4 votes
2 answers
220 views

Is Joomla4 API/Web Service ready for production use?

I've read what little I can find about J4 Web Services, but cannot find a working example or get my code to work. The code below should work by all accounts, but I get forbidden on my local machine ...
user avatar
  • 7,665
4 votes
2 answers
418 views

Adding ajax call in a module for Joomla 4

I'm trying to add an ajax call to Article Latest module. I added the code below to /modules/mod_articles_latest/src/Helper/ArticlesLatestHelper.php public static function getAjax() { $data ...
user avatar
  • 2,388
4 votes
1 answer
557 views

Replacing JSubmenuHelper with JHtmlSidebar / Administrative menu in Joomla 4

I've been racking my brain how to add links to all the views of my component in the shiny new Joomla4 backend; I used to do it via JSubmenuHelper, but that, apparently being deprecated also before, ...
user avatar
  • 161
3 votes
1 answer
953 views

How to use HTMLHelper to add to the document head

In this post: How to add CSS/JS/an Image to a module backend @lodder shows me how to use HTMLHelper to add CSS and JavaScript. Previously I had followed the Joomla! documentation https://docs.joomla....
user avatar
  • 1,829
3 votes
1 answer
103 views

Is the following everything one should do to prevent SQL injection?

In order to sanitize the user input in an article insertion form (title and HTML content), here are the bits that I've included: Use of JInput: $jinput = JFactory::getApplication()->input; get ...
user avatar
3 votes
1 answer
136 views

Best Practice: Loading component Styles & Scripts in J4

What is the best practice for loading styles and scripts? Option 1: HTMLHelper::stylesheet(Uri::base().'media/com_mycomponent/css/mycomponent.css'); Option 2: $wa = Factory::getApplication()->...
user avatar
3 votes
1 answer
54 views

Where are plugins found in Joomla 4?

I'm working with the Joomla 4 alpha 7, and I don't see anywhere to enable / disable plugins. Are plugins not enabled yet? [edited to add alpha, not beta!]
user avatar
  • 1,089
3 votes
1 answer
262 views

Menu Model Item in Joomla 4

Does anyone know how can I get the current menu model in Joomla 4? In 2.5/3.X I was using this code: $model = JModelLegacy::getInstance( 'MenusModelItem' ) ->getItem(); But this ...
user avatar
3 votes
1 answer
588 views

Joomla4 plugin getBody

In Joomla 3.x versions I use JResponse to get and set the body. function onAfterRender() { $content = JResponse::getBody(); ... } But in Joomla4 it returns Class 'JResponse' ...
user avatar
  • 133
2 votes
2 answers
240 views

addScriptDeclaration is not working

I am trying to add an inline Javascript in my Joomla 4 plugin using addScriptDeclaration().I edited the code like suggested but the plugin is not working .After enabling it , it is not doing anything ....
user avatar
2 votes
2 answers
154 views

TinyMCE in Joomla 4: <custom-element> without automatically added <p>

Can someone please tell me how it becomes possible in TinyMCE that a custom HTML element e.g. <my-custom-element>text...</my-custom-element> when saving the article is NOT always forcibly ...
user avatar
2 votes
1 answer
46 views

Creating a field plug-in, need the com_content form to be enctype multipart

I've been writing a field plug-in for adding files to articles in com_content. I've got the basics of the field plug-in working ok, extending the JFormFieldFile class The issue I've hit is, for the ...
user avatar
2 votes
1 answer
356 views

Proper way for autoloading in Joomla 4

I'm trying to make my news module modification working with Joomla 4. My module is calling custom fields and I use this autoloader below to make it work in Joomla 4. Can you tell me what is the proper ...
user avatar
  • 2,388
2 votes
1 answer
525 views

Class not found in Joomla 4 when using JDate inside a function

In my last question I tried to modify mod_latest_articles module, and added myCustomFunction to ArticlesLatestHelper.php like this : /** * @package Joomla.Site * @subpackage ...
user avatar
  • 2,388
2 votes
1 answer
515 views

Joomla 4 alpha mootools library

To whom it may concern: I just installed joomla 4.0 alpha and installed a custom extension of mine there in which uses mootools (JHTML::_('behavior.modal');), but it simply does not work. is there ...
user avatar
2 votes
1 answer
36 views

HTMLHelper call a custom class in a module

In the xml file for a module, I call a custom field class: <config> <fields name="params"> <fieldset name="basic" addfieldprefix="Myextension\Name\...
user avatar
2 votes
2 answers
83 views

JRoute don't make a SEF Url from the article link

When I use Route method to convert a normal url in a SEF url it doesn't work if the article is not a menu item. I don't understand if it's a normal behavior or if I'm doing something wrong. There is ...
user avatar
2 votes
1 answer
24 views

How to check if site is in maintenance mode in Joomla 4?

I need to determine if the site is in maintenance mode. Pseudo code: if (*site is in maintenance mode*) { // do this } else { // do this other thing }
user avatar
2 votes
1 answer
54 views

Invalid controller class from custom component ajax call to json method

I have an existing J3 component admin view which fires off a Javascript Ajax call to a Json controller and fetches back data which I then incorporate into that view. I'm trying to replicate how I've ...
user avatar
2 votes
1 answer
32 views

Joomla don't see subgroups in the Articles tab (Joomla 4)

I set up three users. To make things easier, let's take the following names: X, Y, Z. Additionally, there are subgroups in the Registered group, let's call them X_group, Y_group and Z_group. User X ...
user avatar
2 votes
1 answer
153 views

Joomla 4.0 Text sprintf

I know at some point sprintf was a method of the JText class, but it doesn't seem to work in Joomla 4.0. I tried the following, not working: $str = Text::sprintf('...
user avatar
  • 395
2 votes
1 answer
534 views

Joomla 4 namespacing and autoloading

I've added the namespace line to my manifest xml: <namespace>Mycompany\Component\Mycomponent</namespace> When I install the component, I'm not seeing any alias added to the libraries/...
user avatar
  • 1,089
2 votes
1 answer
677 views

Updating JEventDispatcher triggers

Can anyone explain or point me to information on the new way to handle events in Joomla 4? I'm updating a component that uses triggers to display plugins, and it looks like this: $dispatcher = ...
user avatar
  • 1,089
2 votes
1 answer
179 views

How to use cache calls in Joomla 4

From the documentation I use this part to store a large chunk of data if (empty($families)) { $cache = Factory::getCache(); $families = $cache->call( array( 'JFormFieldFamily', 'getFamilyList' ...
user avatar
  • 395
2 votes
1 answer
291 views

Fatal Error: Class 'ArticlesLatestHelper' not found in Joomla 4 module while trying to add new function

I'm testing and playing with Joomla 4 alpha. What I tried to do is to quick-edit / modify the module Latest Article (mod_articles_latest), adding a new function. In joomla 3.x I usually adding a new ...
user avatar
  • 2,388
2 votes
1 answer
28 views

Custom Fields inside Articles News Module in Joomla 4

I want to show some specific Custom Fields inside the Joomla 4 Articles News (mod_articles_news) module. I used to use this code in Joomla 3 : <?php $customFields = FieldsHelper::getFields('...
user avatar
  • 319
2 votes
1 answer
28 views

Scheduled task only running when logged in0

I built a Joomla plugin for a task and I scheduled that task to run every 5 minutes. While monitoring the task it seems it is only running when I am logged into the administrator back end if the site....
user avatar
  • 57
2 votes
1 answer
52 views

Is showing a Joomla API token in JS a security risk?

I have created a couple of web services under Joomla 4 that are simple enough calls to the same website to refresh a couple of fields when something else changes. In my JS code I have the 'X-Joomla-...
user avatar
  • 2,220
2 votes
1 answer
33 views

Reducing frequency of the "Joomla! update available" mails to once per day or once per week

Is there a way to reduce the frequency of the automatic "Joomla! Update available" mails? I do not want to disable the plugin, because I want to be notified about updates. But multiple mails ...
user avatar
  • 175
2 votes
1 answer
53 views

Add a field (Sql or List) in article options with a search bar inside in Joomla 4

I added a field type "sql" to show a list of options in the Article Options in Joomla 4. But I need to add a field like this with a search box inside to looking for one of the voices typing ...
user avatar
2 votes
2 answers
170 views

Loading a helper file in Joomla 4

I'm having trouble with using a helper file in Joomla 4, I'm not really sure where I'm going wrong. I have a helper file in my template, like templates/mytemplate/html/helper.php and this works well ...
user avatar
2 votes
1 answer
79 views

Are custom fields updatable using joomla 4 api?

Simply put when using the API to update a custom field of an article, the new information is not successfully passed through. Furthermore, the original contents are deleted from the field. The ...
user avatar
  • 45
2 votes
1 answer
35 views

Getting somehow the Article ID in an Alternate Layout for Custom Fields

I am creating an Alternate Layout of /components/com_fields/layouts/field/render.php to change the layout of some given Custom Fields. And there I need the ID of the article in order to give a unique #...
user avatar
2 votes
1 answer
72 views

How to properly display editor instance in Joomla 4

I'm currently updating my component to work in Joomla 4, and I've run into an issue with editors. I previously used this: $editor = JFactory::getEditor(); $editor->display('text', $this->item-&...
user avatar
  • 278
2 votes
1 answer
460 views

Joomla 4 website's backend not working after renaming htaccess.txt to .htaccess

I got a issue after renaming htaccess.txt to .htaccess in the public_html folder of my Joomla 4 website (https://www.freepetsitters.com). I renamed it in order to get rid of "index.php" in ...
user avatar
2 votes
1 answer
597 views

Get the Article ID in J4.0

I am trying Joomla 4. My biggest problem is to migrate the get article id functionality. In Joomla 3.x, I used: defined('_JEXEC') or die; $id= JRequest::getInt('id'); but this is not longer ...
user avatar
  • 344
2 votes
1 answer
197 views

Joomla 4 addfieldpath

Has the addfieldpath parameter in custom extension forms changed in Joomla 4? The Joomla admin is no longer finding my component's customized field types. I'm using addfieldpath="/administrator/...
user avatar
  • 1,089
2 votes
1 answer
88 views

Joomla 4 API Question

How to convert a custom Joomla 3 to Joomla 4, and use the Joomla 4 web services API? I have an extension I wrote for J3 and with a bit of tweaking it works just fine in J4. I want to add web services ...
user avatar
  • 1,727
2 votes
0 answers
22 views

Joomla MEMORY tables cause an error in creating/editing articles

I am encountering an error with Joomla 4 that has never occurred to me in previous installations. When I try to create/edit an article, a category or to index contents in smart search, I get the ...
user avatar
2 votes
1 answer
46 views

Scheduled Tasks Infrastructure in Joomla 4.1

Is there documentation for the new Scheduled Tasks Infrastructure in Joomla 4.1 (https://github.com/joomla/joomla-cms/pull/35143)? I just created a test task for setting the site offline. I scheduled ...
user avatar
  • 31
2 votes
2 answers
48 views

API - get menu items from specific menu

I can't guess how to get menu items from a specific menu via API. I use: https://github.com/alexandreelise/j4x-api-collection https://documenter.getpostman.com/view/9617873/Szzj9yJy#6ac385da-724b-4b5b-...
user avatar
2 votes
0 answers
25 views

Transfer of the site, with change of the database (MySQL to MariaDB)

I built my website with Joomla4 and a MySQL8.0 database. Unfortunately, I need to transfer my site to a server using MariaDB10.4, which isn't compatible with MySQL8.0. I'm not a programmer and ...
user avatar
2 votes
0 answers
252 views

Joomla 4 - router.php SEF-URLs broken since update

This current router.php creates in Joomla 4 this URL: localhost/component/ohanah/?id=688&Itemid=101 But it should create this: localhost/kurse/688-event-name where "event-name" is the ...
user avatar
2 votes
2 answers
169 views

Use HTMLHelper::_ by calling a namespaced class

In my component under Joomla! 4.0, I have the following call which returns: error JHtml componentname not found. HTMLHelper::_( 'componentname.link', 'index.php?option=com_component&view=...
user avatar
2 votes
0 answers
129 views

CLI for joomla 4 not working for me

Joomla 4 PHP 7.3.1 Composer and NPM node modules installed Following this doc on Joomladocs, CLI Update, php cli/joomla.php - and whatever command I add after doesn't work. I get an error message (...
user avatar
  • 332
1 vote
3 answers
246 views

What is the current status of Joomla 4.x? [closed]

With the new release strategy in mind, what is the current status of Joomla 4.x? Has the development already started? Is there something on Github? Is there a google group especially for 4.x?
user avatar
  • 3,693
1 vote
2 answers
132 views

Update from 3.9.x to 4.x

I want to try Joomla 4.x In the documentation for Joomla 3.x to 4.x Step by Step Migration it says: Select Joomla Next (This is the current text - it may be different in the future) from the drop-...
user avatar
  • 344
1 vote
2 answers
33 views

CLI function requires a Plugin with an access level of registered

I have a CLI function that runs daily and a key part of its processing uses a Plugin to create a connection with an external source to retrieve data and it works fine when the Access Level on the ...
user avatar
  • 2,220