Action Log - Joomla
plugin**User ??admin?? changed settings of the application configuration**
??admin??
usernameThe user edit page is shown
An error page is shown
Clean Joomla 3.9.4 RC installation
PHP 7.2.15
Apache 2.4.38
Labels |
Added:
?
|
Title |
|
Thats more or less expected behavior because the link is also translated.
The question is why is it needed...
Status | New | ⇒ | Information Required |
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);
}
@HLeithner
Shall I make a PR?
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-03-12 13:02:56 |
Closed_By | ⇒ | HLeithner |
@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.
@HLeithner Why doesn't it happen then in the userlisting?
which userlisting do you mean?
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&task=user.edit&id=800??">??admin??</a>
which evidently breaks them.
@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 :)
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
every PR will be considered but the draft seams wrong to me.
@HLeithner Can you elaborate on what is wrong with it rather than just stating it is wrong.
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
@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.
got your point .... and make sense to me, even in a j4 perspective only
lack of resources is the real issue
Found the correct solution. Making patch now.
confirm