Skip to content

Commit ee66fe6

Browse files
authored
Merge branch '5.0' into notifications
2 parents 0ed506d + e5b7ff3 commit ee66fe6

23 files changed

Lines changed: 200 additions & 75 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php declare(strict_types=1);
2+
3+
use Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery;
4+
use Ibexa\Contracts\Core\Repository\Values\Content\Query;
5+
6+
/** @var \Ibexa\Contracts\Core\Repository\SearchService $searchService */
7+
8+
// For location searches
9+
$locationQuery = new LocationQuery();
10+
$locationQuery->performCount = false;
11+
12+
$locationResult = $searchService->findLocations($locationQuery);
13+
14+
// For content searches
15+
$contentQuery = new Query();
16+
$contentQuery->performCount = false;
17+
18+
$contentResult = $searchService->findContent($contentQuery);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php declare(strict_types=1);
2+
3+
/** @var \Ibexa\Contracts\HttpCache\ResponseTagger\ResponseTagger $responseTagger */
4+
/** @var \Ibexa\Core\MVC\Symfony\View\ContentValueView|\Ibexa\Core\MVC\Symfony\View\LocationValueView $view */
5+
$responseTagger->tag($view); // When working with a view
6+
7+
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Content $content */
8+
$responseTagger->tag($content->getContentInfo()); // When working with a content item
9+
10+
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Location $location */
11+
$responseTagger->tag($location); // When working with a location
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php declare(strict_types=1);
2+
3+
/** @var \Ibexa\Contracts\ActivityLog\ActivityLogServiceInterface $activityLogService */
4+
$activityLogService->disable();
5+
6+
// Perform operations that should not be logged to the activity log
7+
// ...
8+
9+
$activityLogService->enable();

code_samples/recommendations/events/product_visit_event.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# templates/product/view.html.twig #}
1+
{# templates/product/view.html.twig #}
22
{% extends 'base.html.twig' %}
33

44
{% block content %}

docs/administration/recent_activity/recent_activity.md

Lines changed: 53 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,62 @@ Recent activity log displays last actions in the repository (whatever their orig
1010

1111
To learn more about its back office usage and the actions logged by default, see [Recent activity in User Documentation]([[= user_doc =]]/recent_activity/recent_activity/).
1212

13-
## Configuration and cronjob
13+
## Configuration
1414

15-
With some configuration, you can customize the log length in the database or on screen.
15+
With some configuration, you can customize the log length in the database or on screen, or disable the logging completely.
1616
A command maintains the log size in database, it should be scheduled through CRON.
1717

18-
- The configuration `ibexa.system.<scope>.activity_log.pagination.activity_logs_limit` sets the number of log items shown per page in the back office (default value: 25).
19-
A log item is a group of entries, or an entry without group.
20-
- The configuration `ibexa.repositories.<repository>.activity_log.truncate_after_days` sets the number of days a log entry is kept before it's deleted by the `ibexa:activity-log:truncate` command (default value: 30 days).
18+
### Log retention
19+
20+
The `ibexa.repositories.<repository>.activity_log.truncate_after_days` setting sets the number of days a log entry is kept before it's deleted by the `ibexa:activity-log:truncate` command (default value: 30 days).
2121

22-
For example, the following configuration sets 15 days of life to the log entries on the `default` repository, and 20 context groups per page for the `admin_group` SiteAccess group:
22+
For example, the following configuration sets 15 days of life to the log entries on the `default` repository:
2323

2424
```yaml
2525
ibexa:
2626
repositories:
2727
default:
2828
activity_log:
2929
truncate_after_days: 15
30+
```
31+
32+
To automate a regular truncation, the command `ibexa:activity-log:truncate` must be added to a crontab.
33+
To minimize the number of entries to delete, it's recommended to execute the command more than one time a day.
34+
35+
For every exact hour, the cronjob line is:
36+
`0 * * * * cd [path-to-ibexa]; php bin/console ibexa:activity-log:truncate --quiet --env=prod`
37+
38+
### Display limit
39+
40+
The `ibexa.system.<scope>.activity_log.pagination.activity_logs_limit` setting sets the number of log items shown per page in the back office (default value: 25).
41+
42+
For example, the following configuration sets 20 context groups per page for the `admin_group` SiteAccess group:
43+
44+
```yaml
45+
ibexa:
3046
system:
3147
admin_group:
3248
activity_log:
3349
pagination:
3450
activity_logs_limit: 20
3551
```
52+
A log item is a group of entries, or an entry without group.
3653

37-
To automate a regular truncation, the command `ibexa:activity-log:truncate` must be added to a crontab.
38-
To minimize the number of entries to delete, it's recommended to execute the command more than one time a day.
54+
### Disable activity log
3955

40-
For every exact hour, the cronjob line is:
41-
`0 * * * * cd [path-to-ibexa]; php bin/console ibexa:activity-log:truncate --quiet --env=prod`
56+
The `ibexa.repositories.<repository>.activity_log.enabled` setting can disable activity log entirely for a given [repository](repository_configuration.md).
57+
58+
For example, to disable the activity log for the `default` repository:
59+
60+
```yaml
61+
ibexa:
62+
repositories:
63+
default:
64+
activity_log:
65+
enabled: false
66+
```
67+
68+
You can also disable activity log for a single action by using the [PHP API](#disable-logging-activities).
4269

4370
## Permission and security
4471

@@ -132,6 +159,7 @@ migration
132159
Keep activity logging as light as possible.
133160
Don't make database requests or heavy computation at logging time.
134161
Keep them for activity log list display time.
162+
If needed, you can [disable logging for specific operations](#disable-logging-activities) using the PHP API.
135163

136164
#### Create an entry
137165

@@ -259,6 +287,21 @@ Thanks to the previous subscriber, the related object is available at display ti
259287
[[= include_code('code_samples/recent_activity/templates/themes/admin/activity_log/ui/my_feature/simulate.html.twig') =]]
260288
```
261289

290+
### Disable logging activities
291+
292+
You can disable logging the activities with PHP API, for example, when loading large amounts of data in cases where you don't want logging to slow down the process or the actions to be included in the log.
293+
294+
Call [`ActivityLogService::disable()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ActivityLog-ActivityLogServiceInterface.html#method_disable)
295+
before running the relevant code, then [`ActivityLogService::enable()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ActivityLog-ActivityLogServiceInterface.html#method_enable) to restore the logging process:
296+
297+
``` php
298+
[[= include_code('code_samples/recent_activity/src/recent_activity_disable.php') =]]
299+
```
300+
301+
When disabled, any call to [`ActivityLogService::save()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ActivityLog-ActivityLogServiceInterface.html#method_save) has no effect and no entries are written to the database.
302+
303+
You can check the current state with [`ActivityLogService::isEnabled()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ActivityLog-ActivityLogServiceInterface.html#method_isEnabled) and [`ActivityLogService::isDisabled()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ActivityLog-ActivityLogServiceInterface.html#method_isDisabled).
304+
262305
## REST API
263306

264307
You can browse activity logs with REST API.

docs/api/event_reference/shopping_list_events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description: Events that are triggered while managing shopping lists.
33
page_type: reference
44
editions: lts-update commerce
5-
month_change: true
5+
month_change: false
66
---
77

88
# Shopping list events

docs/commerce/shopping_list/install_shopping_list.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Install the Shopping list LTS update.
33
editions: lts-update commerce
4-
month_change: true
4+
month_change: false
55
---
66

77
# Install shopping list

docs/commerce/shopping_list/shopping_list_api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Manage shopping lists from PHP API or REST API.
33
editions: lts-update commerce
4-
month_change: true
4+
month_change: false
55
---
66

77
# Shopping list APIs

docs/commerce/shopping_list/shopping_list_design.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Learn how to integrate the shopping list features to your own online store design.
33
editions: lts-update commerce
4-
month_change: true
4+
month_change: false
55
---
66

77
# Shopping list design

docs/commerce/shopping_list/shopping_list_guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: A shopping list allows users to save potential purchases, recurring product sets, and other items for future use in the cart.
33
editions: lts-update commerce
4-
month_change: true
4+
month_change: false
55
---
66

77
# Shopping list feature guide

0 commit comments

Comments
 (0)