What: When the automatic status field is changed by CRON and at the same time an email is sent by sending rule type "editing record", the [URL] field in the email is corrupted.
Changing the constant "CRON_HTTP_SERVER_HOST" in config/server.php does not help.
I believe that problem is in function url_for in \includes\functions\urls.php which is called function output_singe_text in \includes\classes\fieldstypes\fieldtype_text_pattern.php. When the script is launched by CRON, the content of $_SERVER array in url_for() is not correct.
Code: Select all
function url_for() {
...
$host = $_SERVER['HTTP_HOST'];
$self = pathinfo($_SERVER['PHP_SELF']);
...
}
1. Create a field type Automatic status for any entity and set some rules for it.
2. Create an Email Sending Rule, type Editing record for Automatic status field. In message content, add [URL] field.
3. Run /cron/autostatus.php
4. Email is sent with wrong url, e.g. http://usr/home/hosting/html/example.co ... th=25-6480 instead of example.com/index.php?module=items/info&path=25-6480