Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aichat
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
aichat
Commits
3b621d93
Commit
3b621d93
authored
10 months ago
by
mindaugasd
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3437970
by mindaugasd: Add missing 'created' field
parent
c2fba5c5
No related branches found
No related tags found
No related merge requests found
Pipeline
#145836
passed with warnings
10 months ago
Stage: build
Stage: validate
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aichat.install
+19
-0
19 additions, 0 deletions
aichat.install
src/Entity/AIChat.php
+9
-1
9 additions, 1 deletion
src/Entity/AIChat.php
with
28 additions
and
1 deletion
aichat.install
0 → 100644
+
19
−
0
View file @
3b621d93
<?php
use
Drupal\Core\Field\BaseFieldDefinition
;
/**
* Add missing 'created' field
*/
function
aichat_update_8001
()
{
$storage_definition
=
BaseFieldDefinition
::
create
(
'created'
)
->
setLabel
(
t
(
'Authored on'
))
->
setDescription
(
t
(
'The time that the conversation was created.'
))
->
setDisplayOptions
(
'form'
,
[
'region'
=>
'hidden'
])
->
setDisplayConfigurable
(
'form'
,
TRUE
);
$update_manager
=
\Drupal
::
entityDefinitionUpdateManager
();
$update_manager
->
installFieldStorageDefinition
(
'created'
,
'aichat'
,
'aichat'
,
$storage_definition
);
}
This diff is collapsed.
Click to expand it.
src/Entity/AIChat.php
+
9
−
1
View file @
3b621d93
...
...
@@ -108,9 +108,17 @@ class AIChat extends ContentEntityBase implements EntityChangedInterface, Entity
->
setLabel
(
t
(
'Enabled'
))
->
setDisplayConfigurable
(
'form'
,
TRUE
);
$fields
[
'created'
]
=
BaseFieldDefinition
::
create
(
'created'
)
->
setLabel
(
t
(
'Authored on'
))
->
setDescription
(
t
(
'The time that the conversation was created.'
))
->
setDisplayOptions
(
'form'
,
[
'region'
=>
'hidden'
])
->
setDisplayConfigurable
(
'form'
,
TRUE
);
$fields
[
'changed'
]
=
BaseFieldDefinition
::
create
(
'changed'
)
->
setLabel
(
t
(
'Changed'
))
->
setDescription
(
t
(
'The time that the con
tent
was last
edi
ted.'
));
->
setDescription
(
t
(
'The time that the con
versation
was last
upda
ted.'
));
$fields
[
'title'
]
=
BaseFieldDefinition
::
create
(
'string'
)
->
setLabel
(
t
(
'Title'
))
...
...
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
register
or
sign in
to comment