?
avatar roland-d
roland-d
11 Mar 2019

Steps to reproduce the issue

  1. Enable Debug language in Global Configuration
  2. Enable the Action Log - Joomla plugin
  3. Go to Global Configuration
  4. Click Save & close
  5. Go to User -> User Action Log
  6. Notice a line like:
    **User ??admin?? changed settings of the application configuration**
  7. Click on the ??admin?? username
  8. Error page is shown:

image

Expected result

The user edit page is shown

Actual result

An error page is shown

System information (as much as possible)

Clean Joomla 3.9.4 RC installation
PHP 7.2.15
Apache 2.4.38

avatar roland-d roland-d - open - 11 Mar 2019
avatar joomla-cms-bot joomla-cms-bot - change - 11 Mar 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 11 Mar 2019
avatar roland-d roland-d - change - 11 Mar 2019
Title
[3.9.4RC] Invalid controller on clicking username with debug mode
[3.9.4RC] Invalid controller on clicking username with debug language
avatar roland-d roland-d - edited - 11 Mar 2019
avatar alikon
alikon - comment - 11 Mar 2019

confirm

avatar HLeithner
HLeithner - comment - 11 Mar 2019

Thats more or less expected behavior because the link is also translated.

The question is why is it needed...

avatar franz-wohlkoenig franz-wohlkoenig - change - 12 Mar 2019
Status New Information Required
avatar infograf768
infograf768 - comment - 12 Mar 2019

I have a possible patch for that

diff --git a/administrator/components/com_actionlogs/helpers/actionlogs.php b/administrator/components/com_actionlogs/helpers/actionlogs.php
index 71221c4..a7f9a07 100644
--- a/administrator/components/com_actionlogs/helpers/actionlogs.php
+++ b/administrator/components/com_actionlogs/helpers/actionlogs.php
@@ -209,5 +209,14 @@
 			}
 
-			$message = str_replace('{' . $key . '}', Text::_($value), $message);
+			if (strpos($value, 'JOOMLA_TYPE') || strpos($value, 'JOOMLA_APPLICATION'))
+			{
+				$value = Text::_($value);
+			}
+			else
+			{
+				$value = $value;
+			}
+
+			$message = str_replace('{' . $key . '}', $value, $message);
 		}

To get:
Screen Shot 2019-03-12 at 10 35 00

@HLeithner
Shall I make a PR?

avatar HLeithner HLeithner - change - 12 Mar 2019
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2019-03-12 13:02:56
Closed_By HLeithner
avatar HLeithner
HLeithner - comment - 12 Mar 2019

@infograf768 no, in my opinion its not a bug, the string get translated and marked as translated with **.

thx for the report I'm closing this.

avatar HLeithner HLeithner - close - 12 Mar 2019
avatar roland-d
roland-d - comment - 12 Mar 2019

@HLeithner Why doesn't it happen then in the userlisting?

avatar HLeithner
HLeithner - comment - 12 Mar 2019

which userlisting do you mean?

avatar infograf768
infograf768 - comment - 12 Mar 2019

Well, my proposed patch works fine because it prevents the links from being passed through Text::_
The issue is that the code does not use sprintf.

Without patch, when debug lang is on, the links are of the type
<a href="??http://localhost:8888/installmulti/trunkgitnew/administrator/index.php?option=com_users&amp;task=user.edit&amp;id=800??">??admin??</a>

which evidently breaks them.

Screen Shot 2019-03-12 at 17 37 01

avatar infograf768
infograf768 - comment - 12 Mar 2019

@roland-d
in the user manager as elsewhere in core we use Text::sprintf with variables for this kind of links.

avatar roland-d
roland-d - comment - 12 Mar 2019

@infograf768 Thank you for the explanation, that does explain why it works in the User Manager. A patch to fix the broken link is welcome if you ask me. Having a known broken page isn't very nice :)

avatar alikon
alikon - comment - 12 Mar 2019

A patch to fix the broken link is welcome if you ask me.

for me too, but don't want to waste @infograf768 time for a pr with 0 chances to be considered

avatar HLeithner
HLeithner - comment - 12 Mar 2019

every PR will be considered but the draft seams wrong to me.

avatar roland-d
roland-d - comment - 12 Mar 2019

@HLeithner Can you elaborate on what is wrong with it rather than just stating it is wrong.

avatar alikon
alikon - comment - 12 Mar 2019

i would prefer to discuss this argument when even a draft PR will be submitted and not based on an copy&paste snippet ... btw, this is not a high priority issue imo

avatar HLeithner
HLeithner - comment - 12 Mar 2019

@roland-d sorry I talked to jean-marie directly that's the reason I didn't mentioned it here.

I think strpos on a hardcoded string seams wrong, can a plugin also add a url here? strpos() without === should be checked twice. Also if it is really needed to translate the url or only use the sprintf option.

So yes if jean-marie writes a PR we can discuss about it but to be honest we have so many thing to fix in j4 that a wrong url in a debug screen shouldn't be the first priority.

avatar alikon
alikon - comment - 12 Mar 2019

got your point .... and make sense to me, even in a j4 perspective only ?
lack of resources is the real issue

avatar infograf768
infograf768 - comment - 13 Mar 2019

Found the correct solution. Making patch now.

avatar infograf768
infograf768 - comment - 13 Mar 2019

Please test
#24178

Add a Comment

Login with GitHub to post a comment