Questions tagged [joomla-4.x]

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

Filter by
Sorted by
Tagged with
8 votes
1 answer
192 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 ...
Lodder's user avatar
  • 26.9k
5 votes
4 answers
6k 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 ...
user101289's user avatar
  • 1,119
5 votes
1 answer
172 views

Workflow question: How to fix missing com_messages text?

Whenever a user submits and article on one of my sites, the message that comes across has only COM_MESSAGES_NEW_MESSAGE as the subject and COM_MESSAGES_NEW_MESSAGE_BODY. I've tried several things, ...
LMK Web's user avatar
  • 183
5 votes
1 answer
1k 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, ...
codeling's user avatar
  • 181
5 votes
1 answer
717 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-&...
Chaosxmk's user avatar
  • 338
4 votes
3 answers
950 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 ...
Terry Carter's user avatar
  • 1,812
4 votes
2 answers
2k 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 ...
webchun's user avatar
  • 2,418
4 votes
2 answers
528 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 ...
GDP's user avatar
  • 7,715
4 votes
1 answer
623 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()->...
Glenn Arkell's user avatar
4 votes
1 answer
1k views

How to show list of articles filtered by category and custom field

I am looking for a way to show Joomla 4 articles in a category blog filtered by one (or more) of my custom fields. - The category blog settings in the backend seems only allow to filter by category, ...
cappu's user avatar
  • 139
4 votes
1 answer
4k views

'JEventDispatcher' is deprecated in Joomla 4 and what is the replacement

I am using the below code in my current Joomla custom component Joomla\CMS\Plugin\PluginHelper::importPlugin('captcha'); $dispatcher = JEventDispatcher::getInstance(); $res = $dispatcher->trigger('...
Malaiselvan's user avatar
  • 2,731
4 votes
1 answer
87 views

How to properly add a query parameter to my Router?

Given the following menu entries Route::_('index.php?option=com_mycomponent&view=categories&extension=com_mycomponent.countries') should return '/countries' but in fact it returns '/diseases'....
Alexandre Paulo's user avatar
4 votes
0 answers
795 views

(4.1 -> 4.2) Attempted to load class TemplateComponent from namespace Joomla\Component\Administrator\Extension calling $app->getTemplate

I have a file test.php that manually loads the Joomla framework and prints template parameters. <?php // test.php, located in the same directory that index.php is define('_JEXEC', 1); define('...
toblerone_country's user avatar
3 votes
2 answers
2k views

Joomla 4 create article programmatically

I have tried a few ways to create articles programmatically in Joomla 4, but none of my attempts are working. First is to insert data by mysql using $db->getQuery(true) -- the article shows in the ...
Na Nguyễn's user avatar
3 votes
3 answers
400 views

Migrating custom module to Joomla 4

I have a Joomla 3.x module which calls the category name from the database and then shows this in the module position. It does this with: $db = &JFactory::getDBO(); $id = JRequest::...
RustyJoomla's user avatar
  • 2,078
3 votes
1 answer
109 views

Can I delay loading a css file until a user is logged in?

I have a CSS file on a Joomla 4 site using a custom template, that has code that only applies to special views for logged-in registered (manager level) users on the front end that styles list displays ...
Gillian's user avatar
  • 411
3 votes
2 answers
245 views

Register Plugin/Class Joomla

We have a custom login plugin which extends the CMSPlugin. I am trying to register the Class of the plugin inside a module but the following scenarios occur. Case 1 JLoader::register('...
anthi_p's user avatar
  • 67
3 votes
1 answer
74 views

Prefill subform with data rows

Im trying to prefill my subform with datarows from the database. newcustomerform.xml <?xml version="1.0" encoding="utf-8"?> <form addfieldprefix="Mydestiny\Component\...
Jbadminton's user avatar
3 votes
2 answers
542 views

Joomla 4 WebAssetManager error

I'm a little confused on the documentation for adding assets to my component, and getting an error message: There is no "com_supersite.supersite" asset of a "script" type in the ...
James's user avatar
  • 652
3 votes
1 answer
1k views

'getErrorMsg' is deprecated in Joomla 4 and what would be the equivalent

In my custom Joomla component, I got the below code $db = Joomla\CMS\Factory::getDbo(); //some code if (!$row->bind($this->_formdata)) { if($db->getErrorMsg()){ //do some code } ...
Malaiselvan's user avatar
  • 2,731
3 votes
1 answer
2k 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....
Eoin's user avatar
  • 1,909
3 votes
1 answer
314 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 ...
Vincenzo Oliva's user avatar
3 votes
1 answer
2k 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' ...
Syom's user avatar
  • 133
3 votes
1 answer
1k 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 ...
webchun's user avatar
  • 2,418
3 votes
1 answer
738 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 ...
Radek Suski's user avatar
3 votes
1 answer
369 views

How to create an instance of the Joomla CMS from the browser or the command line

Recently there have been a number of questions posted on JSE relating to how to load the Framework that in most cases is really asking how to load up the Joomla CMS either from a command line or via a ...
Irata's user avatar
  • 3,917
3 votes
3 answers
1k views

Joomla 4 - Invalid controller class:display

I'm building a simple component in Joomla 4, and after reading through some tutorials I feel like I've got it right - but I'm getting this error that I can't explain in the admin view An error has ...
James's user avatar
  • 652
3 votes
2 answers
941 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('...
geoplous's user avatar
  • 359
3 votes
1 answer
60 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!]
user101289's user avatar
  • 1,119
3 votes
1 answer
114 views

Joomla 4 API for lightbox

I'm trying to upgrade my site to Joomla 4. In Joomla 3 I used "JHTML::_('behavior.modal');" to display a link to an image inside a lightbox. As also explained in this question: Joomla API ...
Vindert's user avatar
  • 31
3 votes
2 answers
223 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 ...
phunsoft's user avatar
  • 230
3 votes
2 answers
520 views

Invalid controller class: display

I am trying to create a simple component. After installation of the component I get the following error message in the admin view: An error has occurred. 0 Invalid controller class: display I've ...
firecase's user avatar
3 votes
1 answer
467 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/...
user101289's user avatar
  • 1,119
3 votes
0 answers
65 views

Joomla 4 Pre-Update Check Database Fail

I installed Joomla on my webhost (Siteground) using the one-click installer package. I'm currently on v4.3.2 Everything appears to be working as expected apart from the Joomla update option. It keeps ...
jonboy's user avatar
  • 3,603
3 votes
1 answer
323 views

Migrate Users from Joomla 3 to Joomla 4 with same UserIds and Passwords

So I successfully migrated users from a Joomla 3 database into a Joomla 4 database. I am hoping there is a nicer way if anyone has done it. In particular, I couldn't work out how to create a user ...
jamesgarrett's user avatar
  • 3,299
3 votes
0 answers
364 views

The quickest way to get the POST object in Joomla 3 & 4

I've been creating a lot of webservices API endpoints in Joomla 4 lately and wanted to ask: "What's the simplest, fastest, most practical way to get the entire POST object when a controller ...
Joe Hacobian's user avatar
2 votes
3 answers
338 views

How to create a (better) development environment for Joomla 4

I have been writing a custom joomla 4.x component. It's not working. But rather than getting people here to debug my code I want to know how to set up a proper development environment that will give ...
Huw Evans's user avatar
  • 371
2 votes
1 answer
30 views

Custom Module not on the JED how to show compatibility information?

We developed multiple extensions for our clients, but none of them are published on the JED. We also do not want to publish to the JED since they are custom extensions. All our extensions always show ...
purple11111's user avatar
2 votes
1 answer
344 views

How can I filter the Persian alphabet in PHP for Joomla 4?

Before anything, I must say this code works as well for the English language, but in Persian it never works. I use this code on model/celebrities.php. This code shows my frontend model: class ...
Ali Zangeneh's user avatar
2 votes
2 answers
545 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 ....
Devika's user avatar
  • 25
2 votes
1 answer
576 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' ...
thednp's user avatar
  • 415
2 votes
2 answers
134 views

Change title for Categories page on custom component

I'm writing a component that will rely on Joomla's Categories to manage its own categories. Everything's working OK, I just cannot figure out how to change my component's Categories list title. I'd ...
Alexandre Paulo's user avatar
2 votes
1 answer
129 views

How to initialize joomla modal through js

I'm customizing a view in my component, I have tabs, each tab contains a modal, but when adding a new tab using js, I don't know how to initialize the new tab's modal via js?
pdutie94's user avatar
2 votes
1 answer
577 views

Joomla 4 - Profile Plugin

I need a custom profile plugin, so I copied the default user profile, renamed some folders/files, and installed it. It installs as if fine and I can activate it, but the fields don't actually display ...
James's user avatar
  • 652
2 votes
2 answers
188 views

Can we get the featured articles in a GET call through Joomla 4 API?

For now we have api/v1/content/articles, but this gets ALL the articles from the site. I do not need the whole list, just the featured articles. Will we need to create an api-component as a temporary ...
Carlitorweb's user avatar
2 votes
1 answer
110 views

403 error front end editing when HTML comments are in the content

I have a site I'm troubleshooting at the moment where articles won't save via the front end and return a 403 error when you either Save or Cancel editing. After whittling down potential causes, this ...
Patrick Jackson's user avatar
2 votes
1 answer
393 views

How can I remove front-end Edit button from side menus?

Since upgrading to Joomla 4 (currently 4.1.5, but also occurs in a test site with 4.2.2) an Edit button has appeared above each menu in the front-end sidebar. Previously in 3.10.10 the Edit option ...
Dionysus's user avatar
2 votes
1 answer
66 views

Joomla upgrade: 3.10.11 to 4.x

I am trying to upgrade my development server from 3.10.11 (which works fine) to 4.x in preparation for Joomla 3.x going out of support in August 23. When I do run the live update, I get an alert box ...
Huw Evans's user avatar
  • 371
2 votes
1 answer
197 views

How does a custom component store config.xml information

I've been developing a custom component on Joomla 4 for a few months now and I've finally got round to working on the access and permissions side of things. Whenever I try to access the Options for my ...
Grant Hood's user avatar
2 votes
2 answers
586 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 ...
flea over stack's user avatar

1
2 3 4 5
11