Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
eca
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
eca
Commits
8c208810
Commit
8c208810
authored
4 months ago
by
Jürgen Haas
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3486193
by jurgenhaas, kopeboy, danielspeicher: eca_cache Lifetime until expiry improvements
parent
0dae778b
No related branches found
No related tags found
1 merge request
!513
Issue #3469697 by jurgenhaas, freelock, mxh, lexsoft: ECA Form breaks complex IEF widget
Pipeline
#512104
canceled
4 months ago
Stage: build
Stage: validate
Stage: test
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/cache/src/Plugin/Action/CacheActionBase.php
+1
-1
1 addition, 1 deletion
modules/cache/src/Plugin/Action/CacheActionBase.php
modules/cache/src/Plugin/Action/CacheWrite.php
+11
-2
11 additions, 2 deletions
modules/cache/src/Plugin/Action/CacheWrite.php
with
12 additions
and
3 deletions
modules/cache/src/Plugin/Action/CacheActionBase.php
+
1
−
1
View file @
8c208810
...
...
@@ -125,7 +125,7 @@ abstract class CacheActionBase extends ConfigurableActionBase {
*/
protected
function
getCacheTags
():
array
{
$tags
=
[];
if
(
$this
->
configuration
[
'tags'
]
!==
''
)
{
if
(
trim
(
$this
->
tokenService
->
replaceClear
(
$this
->
configuration
[
'tags'
]
))
!==
''
)
{
$tags
=
array_values
(
DataTransferObject
::
buildArrayFromUserInput
(
$this
->
configuration
[
'tags'
]));
}
return
$tags
;
...
...
This diff is collapsed.
Click to expand it.
modules/cache/src/Plugin/Action/CacheWrite.php
+
11
−
2
View file @
8c208810
...
...
@@ -2,6 +2,7 @@
namespace
Drupal\eca_cache\Plugin\Action
;
use
Drupal\Core\Cache\CacheBackendInterface
;
use
Drupal\Core\Form\FormStateInterface
;
use
Drupal\eca\Service\YamlParser
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
...
...
@@ -50,7 +51,13 @@ abstract class CacheWrite extends CacheActionBase {
$value
=
$this
->
tokenService
->
getOrReplace
(
$value
);
}
$expire
=
(
int
)
(
$this
->
configuration
[
'expire'
]
??
-
1
);
$expire
=
trim
(
$this
->
tokenService
->
getOrReplace
(
$this
->
configuration
[
'expire'
]));
if
(
$expire
===
''
)
{
$expire
=
CacheBackendInterface
::
CACHE_PERMANENT
;
}
else
{
$expire
=
(
int
)
$expire
;
}
$tags
=
$this
->
getCacheTags
();
$cache
->
set
(
$key
,
$value
,
$expire
,
$tags
);
...
...
@@ -89,11 +96,12 @@ abstract class CacheWrite extends CacheActionBase {
];
$form
[
'expire'
]
=
[
'#type'
=>
'number'
,
'#title'
=>
$this
->
t
(
'
Lifetime until expiry
'
),
'#title'
=>
$this
->
t
(
'
Expiration time
'
),
'#description'
=>
$this
->
t
(
'The timestamp in seconds when the cached item expires. Set to -1 for unlimited lifetime.'
),
'#default_value'
=>
$this
->
configuration
[
'expire'
],
'#required'
=>
TRUE
,
'#weight'
=>
-
20
,
'#eca_token_replacement'
=>
TRUE
,
];
$form
[
'tags'
]
=
[
'#type'
=>
'textarea'
,
...
...
@@ -103,6 +111,7 @@ abstract class CacheWrite extends CacheActionBase {
]),
'#default_value'
=>
$this
->
configuration
[
'tags'
],
'#weight'
=>
-
10
,
'#eca_token_replacement'
=>
TRUE
,
];
return
parent
::
buildConfigurationForm
(
$form
,
$form_state
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment