## Preparations
In the `modules\in-news\units\articles\articles_event_handler.php` file replace `$resource_ids[] = $category_data['ResourceId'];` line with:
```
lang=php
$resource_ids[] = $category_data['ResourceId'];
$category = $this->Application->recallObject('c', null, array('skip_autoload' => true));
$category->SetDBField('l1_Name', 'Test_' . time());
$category->SetDBField('ParentId', $category_id);
$category->Create();
```
In the `core\units\categories\categories_config.php` file add `CreatedById` field to the `Default` grid:
```
lang=php
'CreatedById' => array('filter_block' => 'grid_like_filter', 'title' => 'la_fld_CreatedById'),
```
In the `core\units\mailing_lists\mailing_lists_config.php` file add `PortalUserId` field to the `Default` grid:
```
lang=php
'PortalUserId' => Array ('filter_block' => 'grid_like_filter', 'title' => 'la_col_FromUser'),
```
In the `core\units\spam_reports\spam_reports_config.php` file add `ReportedById` field to the `Default` grid:
```
lang=php
'ReportedById' => Array ('filter_block' => 'grid_like_filter', 'title' => 'la_col_FromUser'),
```
In the `themes\advanced\platform\designs\default_design.des.tpl` file add after <body> tag:
```
lang=html
Created By: <inp2:st_Field name="CreatedById"/>, Modified By: <inp2:st_Field name="ModifiedById"/>.
```
In the `modules\in-commerce\units\products\products_config.php` file add `CreatedByIdId` field to the `Default` grid:
```
lang=php
'CreatedById' => array('filter_block' => 'grid_like_filter', 'title' => 'la_fld_CreatedById'),
```
In the `tools\run_event.php` comment out line:
```
lang=php
exit_code(1, 'This script needs to be enabled manually !');
```
## Testing (part 1 - rss feed import as "system" user and "system" user infusion via "Test_" categories for scheduled tasks)
# Go to {nav Website & Content > Structure & Data} section
# Select `News` category, edit its `Properties` tab:
# set `1` into `Update Interval` field
# set `https://wordpress.org/news/feed/` into `Source URL` field
# Enable `Use Cron to run Scheduled Tasks` system setting in {nav Configuration > Website > Advanced} section
# Enable `n:OnUpdateRSSArticles` scheduled task execution in the {nav Configuration > Website > Scheduled Tasks} section
# Run `php tools/cron.php`
# Confirm that new automatic articles appear with `Author = system`
# Confirm that new categories with names `Test_{some number}` created under News category, and for that `Test_` categories `Created By = 'system'`
# Disable `n:OnUpdateRSSArticles` scheduled task execution in the {nav Configuration > Website > Scheduled Tasks} section
## Testing (part 2 - the "run_event.php" script infusion of "system" user via "Test_" categories)
# Run the `php tools/run_event.php n:OnUpdateRSSArticles b674006f3edb1d9cd4d838c150b0567d` in the root folder of a project
# Confirm that new categories with names `Test_{some number}` created under `News` category, and for that `Test_` categories `Created By = 'system'`
## Testing (part 3 - system log)
# Go to {nav Tools > System Tools}
# do a full cache rebuild (triggers some system log records)
# Go to {nav Tools > Query Database} section
# Run SQL like `UPDATE inp_SystemLog SET LogUserId = -3;`
# Go to {nav Logs & Reports > System Log} section
# Confirm that no SQL error happens
# Confirm that `system` value is shown in the `Username` column of the `System Logs` grid
## Testing (part 4 - mailing lists)
# Go to {nav User Management > Mailings} section
# Add some record
# Go to {nav Tools > Query Database} section
# Run SQL like `UPDATE inp_MailingLists SET PortalUserId = -3;`
# Confirm that `system` value is shown in the `From User` column of the `Mailings` grid
## Testing (part 5 - spam reports)
# Go to {nav Tools > Query Database} section
# Run SQL like `INSERT INTO inp_SpamReports VALUES (DEFAULT, 'p', '1', 'Test', UNIX_TIMESTAMP(), '-3');
# Go to {nav Logs & Reports >SPAM Reports} section
# Confirm that `system` value is shown in the `From User` column
## Testing (part 6 - categories)
# Go to {nav Tools > Query Database} section
# Run SQL like `UPDATE inp_Categories SET CreatedById = -3, ModifiedById = -3;`
# Open front-end index page.
# Confirm text appeared at the top of the page: `Created By: system, Modified By: system`.
## Testing (part 7 - system event subscriptions)
# Go to {nav Tools > Query Database} section
# Run SQL: UPDATE inp_EmailTemplates SET BindToSystemEvent = 'u:OnCreate' WHERE TemplateId = 1
# Run SQL: INSERT INTO `inp_SystemEventSubscriptions` (`SubscriptionId`, `EmailTemplateId`, `SubscriberEmail`, `UserId`, `CategoryId`, `IncludeSublevels`, `ItemId`, `ParentItemId`, `SubscribedOn`) VALUES (NULL, 1, '', '-3', NULL, '1', NULL, NULL, NULL)
# Go to {nav User Management > User Subscriptions} section
# Confirm that `system` value is shown in the `User ID` and `Username` columns
## Testing (part 8 - orders)
# Go to {nav E-commerce > Orders} section
# Create some order
# Go to {nav Tools > Query Database} section
# Run SQL: UPDATE inp_Orders SET PortalUserId = -3
# Go to {nav E-commerce > Orders} section
# Confirm that orders have `system` value in the `Customer Name` column
## Testing (part 9 - products)
# Go to {nav Website & Content > Products} section
# Create some product
# Go to {nav Tools > Query Database} section
# Run SQL: UPDATE inp_Products SET CreatedById = -3
# Confirm that products have `system` value in the `Created By` column