New answers tagged

2 votes

Does Showon attribute for list options work with Joomla 4?

Finally I manage to get this working in my component. I needed to add the javascript in the layout, like this: $wa = $this->document->getWebAssetManager(); $wa->useScript('showon');
user avatar
  • 197
0 votes

JRequest Method in Joomla 4

This is some of the current code inside my controller: function add() { if(JRequest::checkToken( 'get' )) { JRequest::checkToken( 'get' ) or die( 'Invalid Token' ); } else { ...
user avatar
2 votes
Accepted

How to add Toggle Inline Help button to config

Found the solution. In the config.xml file add an element such as: <inlinehelp button="show" /> Works like a charm.
user avatar
1 vote

JRequest Method in Joomla 4

Use Joomla\Input\Input class. Instance relevant to the current request can be accessed through the application: use Joomla\CMS\Factory; $controller->execute(Factory::getApplication()->getInput()...
user avatar
  • 8,222
1 vote

Joomla 4: Error when I use getArticleRoute

You need to register extension namespaces to use extension classes. This can be done with JNamespacePsr4Map::load(): JLoader::register('JNamespacePsr4Map', JPATH_LIBRARIES . '/namespacemap.php'); (new ...
user avatar
  • 8,222
1 vote

Is it possible to make it so that authors can edit their own published articles creating a new unpublished version of them?

The ability for people with only Author level access to edit their own articles, ones they have created, is limited to only Articles that are Published, meaning they cannot edit an Article they have ...
user avatar
  • 2,180
4 votes

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

First, when reading user input you should make sure it's the correct type. The Input/Filter APIs don't handle array/string conversion. So if you're expecting STRING filter to return a string be aware ...
user avatar
  • 8,222
2 votes
Accepted

Is it possible to remove the "new article" button from all sections in a Joomla website?

With some minor configuration tweaks, and some better understanding of Joomla's Access Control Levels, you can easily achieve what you're trying to do. My Joomla Magazine article from June 2021 will ...
user avatar
2 votes

Attempt to assign property "team" on bool

Well, your code is saying that $this->_item might be null (a non-object) -- if it is, you are overwriting it to be false (again, a non-object). Then, after grabbing your database results, you are ...
user avatar
  • 4,388
1 vote

Override a method of the Indexer class (com_finder) using a plugin

I don't think you have correctly grasped how the Plugin can be used to override a function. In your example there is nothing to connect the function toggleTables with the Indexer class you are trying ...
user avatar
  • 2,180
0 votes

How can I sort an unordered list alphabetically by class with JavaScript or PHP?

Use usort() to sort $legend->markers array: usort( $legend->markers, static fn ($a, $b) => $a->locationtype_id <=> $b->locationtype_id );
user avatar
  • 8,222
1 vote

select onChange changed to on-change after saving Joomla 4.1 form

Well, in fact, I found the issue. It is related to some settings of the editor. I will contact the developer. [EDIT] Developer contact is unavailable if you don't have a paid subscription etc. Anyway,...
user avatar
  • 21
0 votes

How can I sort an unordered list alphabetically by class with JavaScript or PHP?

I solved it with some vanilla JavaScript. I'd still like to know how it could be done in PHP as the JavaScript runs after page load and on a slow page load the resort might be visible to the naked eye....
user avatar
  • 161
0 votes

Updated to Joomla 4 and custom PHP scripts no longer run

Your code looks from the Joomla 2.5 era and is outdated. The DS constant is not used since Joomla 3: The DS constant has been removed. If you really need it you can use DIRECTORY_SEPARATOR instead. ...
user avatar
  • 1,313

Top 50 recent answers are included