Questions tagged [joomla-4.x]
For questions regarding version 4.x of the Joomla! Content Management System.
456
questions
0
votes
1
answer
114
views
Trying to write a custom form field that concatenates <input> and <select> values
I am a novice dabbler in Joomla PHP. I can build custom templates and simple frontend modules. I’m trying to write my first custom form field. I’ve gone over the documentation, reviewed several ...
5
votes
1
answer
574
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-&...
3
votes
1
answer
542
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()->...
1
vote
2
answers
211
views
Security concern in Joomla .php: is define('_JEXEC', 1) safe to use?
I came across this on joomla.stackechange which has me concerned:
"define('_JEXEC', 1) is a bad for security in the module. It allows people to use this file as an alternative entry point for ...
8
votes
1
answer
181
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 ...
1
vote
0
answers
166
views
Multiple Stripe Webhooks for checkout.session.completed from various Joomla components
Scenario
Site has OSMembership for subscriptions
Site has RSForms Pro for registering for in person / virtual courses
Site has J2Store for some miscellaneous products
In Stripe, I've set up two ...
0
votes
1
answer
259
views
Joomla 4 extension language files no longer go to 'site/languages/en-GB' when install via discovery
I'm developing a template and I find it both interesting and confusing to how Joomla 4 loads language files.
First there is the templateDetails.xml notation:
Cassiopeia uses
<languages folder="...
0
votes
1
answer
129
views
loadForm change behaviour from J!3.9 to J!4.0 and data not loaded with the form
In my component in a model backend, I'm loading a form but since moving the code to be used on J!4.0 the data associated to the form isn't loaded anymore.
The loadForm is called: https://github.com/...
1
vote
1
answer
1k
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
1k
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
484
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
530
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
1k
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
565
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
690
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
241
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
133
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
217
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
190
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
387
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
218
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
918
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
484
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
188
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
418
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
1k
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
585
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
199
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
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' ...
1
vote
1
answer
291
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
99
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
88
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
222
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
1k
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
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....
0
votes
1
answer
56
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
48
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
184
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
499
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
668
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');
...
1
vote
1
answer
1k
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\...
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 ...
2
votes
1
answer
447
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
638
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 ...
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 ...
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!]
0
votes
1
answer
171
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 ...