?
avatar PixedBo
PixedBo
18 Nov 2017

Steps to reproduce the issue

Create a custom module and name it something with a white space in the end, like "Something ". Then go inside an article and load a module from the button "Load module", and select the "Something " module.

Expected result

The module is loaded in the article

Actual result

Nothing shows up

System information (as much as possible)

Joomla 3.8.2 with nothing installed except the core

Additional comments

The problem is caused by the white space:

  • The module has the name "Something "
  • The loadmodule button writes "{loadmodule mod_custom,something }" with the whitespace at the end
  • I think that the whitespace is ignored so the module is not loaded
  • If i modify the code "{loadmodule mod_custom,something}" without the whitespace the module is not loeade either
  • If i remove the whitespace from the code "{loadmodule mod_custom,something}" AND from the module title it works again

I think it's important to fix because with copy/paste of the module name is easy to get a whitespace in the end of the name.

avatar PixedBo PixedBo - open - 18 Nov 2017
avatar joomla-cms-bot joomla-cms-bot - change - 18 Nov 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 18 Nov 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 18 Nov 2017
Status New Confirmed
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 18 Nov 2017

Issue confirmed.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18664.

avatar franz-wohlkoenig franz-wohlkoenig - change - 18 Nov 2017
Category com_content com_modules
avatar infograf768
infograf768 - comment - 20 Nov 2017

I guess the only way to solve this is preventing a module Title do be saved with whitespaces.
Patch is easy to do, but it may not be B/C.

diff --git a/administrator/components/com_modules/models/module.php b/administrator/components/com_modules/models/module.php
index 206cac8..8458163 100644
--- a/administrator/components/com_modules/models/module.php
+++ b/administrator/components/com_modules/models/module.php
@@ -919,4 +919,6 @@
 		}
 
+		$data['title'] = JFilterInput::getInstance()->clean($data['title'], 'TRIM');
+
 		// Alter the title and published state for Save as Copy
 		if ($input->get('task') == 'save2copy')
avatar brianteeman
brianteeman - comment - 20 Nov 2017

I doubt it would be b/c if you can currently save a module title with trailing spaces. you never know what a user might do.

avatar tonypartridge
tonypartridge - comment - 21 Nov 2017

The only solution I can see, is for the loadmodule to allow white spaces, if you trim the module title now it would be a B/C since users may have been using white space, I know very unlikely but still...

avatar brianteeman
brianteeman - comment - 22 Dec 2017

@tonypartridge do you think you clouod take a look at this one as well - please

avatar tonypartridge
tonypartridge - comment - 22 Dec 2017

Ok Ok, so I can make it work with spaces but can see why it's done as it is.

I suggest we leave as is because of the BC and apply @infograf768 patch to J4.

avatar franz-wohlkoenig franz-wohlkoenig - change - 23 Dec 2017
Status Confirmed Information Required
avatar franz-wohlkoenig franz-wohlkoenig - change - 26 Dec 2017
Status Information Required Discussion
avatar brianteeman brianteeman - labeled - 25 Mar 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 19 Apr 2019
Title
[3.8.2] Problems loading module inside article with {loadmodule} if there is a whitespace character in the end
Problems loading module inside article with {loadmodule} if there is a whitespace character in the end
avatar franz-wohlkoenig franz-wohlkoenig - edited - 19 Apr 2019
avatar ReLater
ReLater - comment - 19 Apr 2019

Is this issue still dramatically relevant for Joomla 3? The module button now inserts {loadmoduleid 123} when you click on the title of the module but not the title.

avatar franz-wohlkoenig franz-wohlkoenig - change - 19 Apr 2019
Status Discussion Information Required
avatar franz-wohlkoenig franz-wohlkoenig - unlabeled - 19 Apr 2019
avatar alikon
alikon - comment - 19 Apr 2019

can be closed indeed

avatar franz-wohlkoenig franz-wohlkoenig - change - 19 Apr 2019
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2019-04-19 14:28:00
Closed_By franz-wohlkoenig
avatar franz-wohlkoenig franz-wohlkoenig - close - 19 Apr 2019

Add a Comment

Login with GitHub to post a comment