Questions tagged [joomla-4.x]
For questions regarding version 4.x of the Joomla! Content Management System.
348
questions
1
vote
1
answer
889
views
Joomla4: Load a custom stylesheet (admin.css.php) in administration
I want my custom modules & custom template to fetch the parameter values (colors) from my custom template's backend. This way I can see what colors I'm picking when when I'm configuring my website....
0
votes
2
answers
775
views
How to Fix PHP Deprecated : Factory::getDocument() is deprecated
How can I fix the following deprecation error generated by my php code?
Factory::getDocument() is deprecated
$app = Factory::getApplication();
$wa = $app->getDocument()->getWebAssetManager();
...
2
votes
2
answers
395
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 ....
2
votes
2
answers
380
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=...
2
votes
1
answer
962
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 ...
2
votes
1
answer
381
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('...
2
votes
2
answers
460
views
What is url for calling task in controller for Joomla 4?
This is my ajax query for calling a task in the controller (it works for Joomla 3 but doesn't work for Joomla 4):
$.ajax({
type: "POST",
url: "index.php?option=com_scrib&...
0
votes
1
answer
74
views
How to check an extension is namespaced?
I'm working on namespaced templates feature and I came to the point where I need to check if an extension is namespaced or not.
One possibility would be to load the templateDetails.xml file and check ...
2
votes
1
answer
2k
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 ...
0
votes
0
answers
234
views
Warning! Internet Explorer should not be used error, on mobile browsers
After some problems with a Joomla 4( beta 6) install on ubuntu 18.04 with Nginx tried another instance for test purposes. This time on an Ubuntu 20 server with Litespeed( Open LS). Wich I don't know ...
1
vote
1
answer
114
views
Workflows in Joomla 4
As we all know Joomla 4 is on the horizon and the improvement to workflows are definitely an interesting addition.
From what I've seen, the workflow works great for new content, but what about content ...
1
vote
0
answers
173
views
Joomla 4: ID state of last saved row not available via $this->getState($this->getName() . '.id')
So i have a strange effect when trying moving a MVC component of mine to Joomla 4. I could break it down to a very simple test.
If you look at the \libraries\src\MVC\Model\AdminModel.php file around ...
0
votes
0
answers
171
views
Joomla 4 not showing error in admin Panel
I am using Joomla 4 and working on a custom module and getting this error in my Joomla admin site. My problem is I am unable to get the error details instead I only get this Error: The 'atum' service ...
0
votes
1
answer
349
views
Sign Up / Login with just OTP
I had a request to build a website for a targeted market that is allow its user to signup using their phone number only without entering email address just like mobile apps nowadays. I know this can ...
1
vote
2
answers
194
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-...
2
votes
1
answer
695
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 ...
1
vote
1
answer
390
views
How to get the currently installed Joomla! Version in PHP
For one of my extensions i need a switch statement if the Joomla! Version is 3.x or 4. (in fact i have to call the Articles Model in different way for J4) - but how can i get the actual installed ...
0
votes
1
answer
164
views
Optional fields in renderFieldset
I'm updating a component of mine to use the renderFieldset method and remove some unnecessary code in the form template files. However, some of my fields show / hide based on other preferences in the ...
3
votes
1
answer
340
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/...
2
votes
1
answer
878
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/...
1
vote
2
answers
463
views
How to set the view location in Joomla 4
I'm rebuilding a component called DogWalk for Joomla 4 and I've tried to ensure I'm doing exactly what the core Banners component does. I've named and namespaced my files, named my directories ...
2
votes
0
answers
168
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 (...
3
votes
1
answer
1k
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' ...
1
vote
1
answer
236
views
As JSubmenuHelper is deprecated, how to migrate to JHtmlSidebar?
The only source I found about this is from this post: Replacing JSubmenuHelper with JHtmlSidebar / Administrative menu in Joomla 4
The issue here is that I tried it, and it doesn't show the Sidebar ...
0
votes
1
answer
92
views
How to render nested modules, (parent outside articles)
I tried the following code:
$document = JFactory::getDocument();
$renderer = $document->loadRenderer('modules');
$position = 'precisions';
$options = array('style' => 'raw');
echo $...
0
votes
0
answers
87
views
How to package modules with admin back-end
Say I want to take mod_custom as a base for a future module. This module has an admin back-end and is not provided as package.
After modifications, how can I package it for installation? Seems there ...
1
vote
1
answer
199
views
How to set a root article as subpath url for children articles
How to set a root article as sub-path URL for children articles?
Meaning, I have a root page named article0, and article{1-100} under this root article.
I want to display the article0 under the URL ...
2
votes
1
answer
895
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 = ...
3
votes
1
answer
1k
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....
0
votes
1
answer
54
views
Editing a module from another component
Suppose I want to edit the field ("Home") of a module (say mod_breadcrumbs) from edit.php file of another module.I want to use the radio button inside another module instead of using here. Is this ...
-2
votes
1
answer
40
views
What does the line in the code below does? [closed]
$hasContent = empty($this->item->module) || isset($this->item->xml->customContent);
line 23 in /administrator/components/com_modules/tmpl/module/edit.php
0
votes
1
answer
47
views
Where might the code for this screenshot lie in joomla 4 [closed]
The link to this url on localhost is administrator/index.php?option=com_menus&view=item&client_id=0&layout=edit&id=101
0
votes
0
answers
172
views
Access namespaced custom field method from a plugin into another plugin
In one of my previous questions, I learned how to properly set up a namespaced custom form field, but it turns out that it's only available within its plugin scope for some reason.
I need the field ...
2
votes
1
answer
368
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' ...
1
vote
1
answer
551
views
Joomla 4 - import parent field class into extending field class issue finding the files
Testing my Joomla 3.9 extensions in Joomla 4, some of them didn't work, because, as instructed with the (probably) old documentation my custom fields use
jimport('joomla.form.formfield');
...
0
votes
1
answer
976
views
Joomla 4 - how to set namespace for custom field addfieldprefix
I have the editors-xtd\vimeo plugin with this structure
..\plugins\editors-xtd\vimeo\models\fields\(a bunch of custom fields)
..\plugins\editors-xtd\vimeo\forms\form.xml
..\plugins\editors-xtd\vimeo\...
2
votes
1
answer
791
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 ...
2
votes
1
answer
391
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 ...
1
vote
1
answer
544
views
How to set up Joomla! 4 properly
I'm trying to do a pull request for Joomla! 4.
I've downloaded the repro and changed branch but now I need a working copy of J4 so I can test my code.
I try to install it the usual way but it the ...
4
votes
4
answers
4k
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 ...
3
votes
1
answer
58
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!]
0
votes
1
answer
159
views
Joomla 4 beta - Internal Service Error but no logged error
I've installed Joomla 4 beta 7 for development upgrading a Joomla 3 component. I have my logs (apparently) working correctly and I have test error log messages printing to the PHP error log as ...
1
vote
1
answer
110
views
Virtuemart 3.4 - products on manufacturer page
Virtuemart 3.4.2, joomla 3.8
i try copy code from category template, but cant fix this errors:
at /my_template/html/com_virtuemart/manufacturer/details.php
NOW I HAVE Two ERRORS:
Call to a member ...
1
vote
1
answer
1k
views
Get Framework and template params in Joomla 4
Joomla 4 is coming soon and i need to know how to get the joomla framework and template params in php files outside of joomla.
This is the way in J3:
define( '_JEXEC', 1 );
define( '_VALID_MOS', 1 )...
4
votes
1
answer
863
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, ...
2
votes
1
answer
763
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 ...
3
votes
1
answer
496
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 ...
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?