PR-6.0-dev Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
27 Aug 2025

Pull Request for Issue #39190

Summary of Changes

The User Action Logs has an option to log the ip address. It is disabled by default.

When the logging of IP addresses is enabled it is shown in the User Action Logs component but there is no option available to include the ip address in any action log emails.

This PR adds the option to include the ip address in those emails. It does not include the ip address unless both

  1. Ip address logging has been enabled in the component options
  2. the ip address message tag is added to the mail template

Testing Instructions

Apply the sql updates
In the User Action Logs options enable the logging of email addresses
Make sure you have a user setup who will receive action log emails
Open the action log mail template and with this PR there is a new tag available (ip address) that you can include in the emails.
Include the tag and check the received email

Actual result BEFORE applying this Pull Request

The default action log mail template does not offer the ability to include the ip address

Expected result AFTER applying this Pull Request

The default action log mail template still does not send the ip address but you now have the capability to include the ipaddress

image

@richard67 could you help me with the sql update please. The one currently in this PR is just a placeholder for a real query

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

365cd2e 27 Aug 2025 avatar brianteeman sql
avatar brianteeman brianteeman - open - 27 Aug 2025
avatar brianteeman brianteeman - change - 27 Aug 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 27 Aug 2025
Category Administration SQL com_admin Postgresql Installation
avatar brianteeman brianteeman - change - 27 Aug 2025
The description was changed
avatar brianteeman brianteeman - edited - 27 Aug 2025
avatar richard67
richard67 - comment - 27 Aug 2025

@richard67 could you help me with the sql update please. The one currently in this PR is just a placeholder for a real query

@brianteeman Example how to add a parameter to a column with a JSON value:

avatar brianteeman
brianteeman - comment - 27 Aug 2025

Thanks @richard67

avatar brianteeman brianteeman - change - 27 Aug 2025
Labels Added: PR-6.0-dev
731963f 27 Aug 2025 avatar brianteeman mysql
d9e2857 27 Aug 2025 avatar brianteeman post
avatar brianteeman
brianteeman - comment - 27 Aug 2025

@richard67 I've updated the queries - its a bit different to your example as here we are just are adding a value to the params not a full column etc . It works but not sure its correct. Not tested the postgres version - thats a chatgpt conversion. Appreciate your expert guidance. Maybe it doesnt even need the json stuff in this situation

avatar richard67
richard67 - comment - 27 Aug 2025

@richard67 I've updated the queries - its a bit different to your example as here we are just are adding a value to the params not a full column etc . It works but not sure its correct. Not tested the postgres version - thats a chatgpt conversion. Appreciate your expert guidance. Maybe it doesnt even need the json stuff in this situation

@brianteeman The examples which I have linked do exactly that, add one new value to the existing params which already might have other values. Check e.g. the documentation of JSON_SET for MySQL. What you are doing now is unnecessarily complicated. The examples which I have linked are complete, it just needs to replace table names and value names.

avatar brianteeman
brianteeman - comment - 27 Aug 2025

ok - i will try again. my first attempt failed miserably

avatar brianteeman
brianteeman - comment - 27 Aug 2025

sorry i give up - all i can succeed as doing is to replace the content of the params field with {"tags": "ipaddress"} instead of appending ipaddress to the tags array

avatar richard67
richard67 - comment - 27 Aug 2025

I will not be able to help before Friday.

avatar richard67
richard67 - comment - 27 Aug 2025

@brianteeman Hmm, I see, the thing is indeed a bit different than my example. But I think there must be an easier way to add an element to an array in a json.
Besides this, you have 2 update SQL script now for postgresql, 6.0.0-2025-03-25.sql and 6.0.0-2025-08-27.sql. I guess the former should be reverted.
Anyway, I will try to find time on Friday or weekend to investigate the necessary SQL statement.

avatar brianteeman
brianteeman - comment - 27 Aug 2025

I'm actually wondering if it can't just be a simple query that replaces the entire column value with the new column values. The only way to have changed it yourself would have been a manual SQL query (hack) so it should be safe

avatar richard67
richard67 - comment - 27 Aug 2025

The only way to have changed it yourself would have been a manual SQL query (hack)

@brianteeman If that is the case, then that would be safe.

486ba59 27 Aug 2025 avatar brianteeman oops
b4a4392 27 Aug 2025 avatar brianteeman sql
avatar brianteeman brianteeman - change - 27 Aug 2025
The description was changed
avatar brianteeman brianteeman - edited - 27 Aug 2025
avatar brianteeman
brianteeman - comment - 27 Aug 2025

Thanks @richard67 I have marked this PR as ready for review now

avatar exlemor exlemor - test_item - 28 Aug 2025 - Tested successfully
avatar exlemor
exlemor - comment - 28 Aug 2025

I have tested this item ✅ successfully on 3af041b

I have successfully tested this and it worked :) I see an IP in my User Action log email! Very cool!

Thanks @brianteeman!


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

Add a Comment

Login with GitHub to post a comment