Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
activitypub
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
activitypub
Commits
862b0455
Commit
862b0455
authored
10 months ago
by
Kristof De Jaeger
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3422516
by chetan 11, swentel, koffer: Error Warning: Undefined array key "uri"
parent
6f425c20
No related branches found
Branches containing commit
Tags
1.0.0-alpha19
Tags containing commit
No related merge requests found
Pipeline
#145698
failed
10 months ago
Stage: build
Stage: validate
Stage: test
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Plugin/activitypub/type/DynamicTypes.php
+8
-3
8 additions, 3 deletions
src/Plugin/activitypub/type/DynamicTypes.php
src/Services/Type/TypePluginBase.php
+7
-1
7 additions, 1 deletion
src/Services/Type/TypePluginBase.php
with
15 additions
and
4 deletions
src/Plugin/activitypub/type/DynamicTypes.php
+
8
−
3
View file @
862b0455
...
...
@@ -75,8 +75,8 @@ class DynamicTypes extends TypePluginBase {
'name'
=>
'Title'
,
'content'
=>
'Content'
,
'summary'
=>
'Summary'
,
'object'
=>
'Like/Announce/Follow target'
,
'inReplyTo'
=>
'Reply link'
,
'object'
=>
[
'label'
=>
'Like/Announce/Follow target'
,
'description'
=>
'This field contains the URL of the object to like/announce/follow.'
],
'inReplyTo'
=>
[
'label'
=>
'Reply link'
,
'description'
=>
'This field contains the URL to the original post you are replying to.'
],
// 'attachment' was originally reserved for 'images' only, but attachments
// can also contain other media types.
'attachment'
=>
[
'label'
=>
'Image attachment'
,
'property'
=>
'attachment'
],
...
...
@@ -111,7 +111,11 @@ class DynamicTypes extends TypePluginBase {
$properties
=
$this
->
getProperties
(
$this
->
getConfiguration
()[
'object'
]);
foreach
(
$properties
as
$property
=>
$info
)
{
$description
=
''
;
$label
=
is_array
(
$info
)
?
$info
[
'label'
]
:
$info
;
if
(
is_array
(
$info
)
&&
!
empty
(
$info
[
'description'
]))
{
$description
=
$info
[
'description'
];
}
$form
[
'field_mapping'
][]
=
[
'property'
=>
[
'#type'
=>
'value'
,
...
...
@@ -121,7 +125,8 @@ class DynamicTypes extends TypePluginBase {
'#type'
=>
'select'
,
'#title'
=>
$this
->
t
(
'Property: @property'
,
[
'@property'
=>
$label
]),
'#options'
=>
$bundle_fields
,
'#default_value'
=>
isset
(
$default_mapping
[
$property
])
?
$default_mapping
[
$property
]
:
''
,
'#default_value'
=>
$default_mapping
[
$property
]
??
''
,
'#description'
=>
$description
,
],
];
}
...
...
This diff is collapsed.
Click to expand it.
src/Services/Type/TypePluginBase.php
+
7
−
1
View file @
862b0455
...
...
@@ -237,7 +237,13 @@ abstract class TypePluginBase extends PluginBase implements TypePluginInterface,
break
;
case
'object'
:
case
'inReplyTo'
:
$return
=
$value
[
0
][
'uri'
];
// This can either be a link field or just a text field.
if
(
!
empty
(
$value
[
0
][
'uri'
]))
{
$return
=
$value
[
0
][
'uri'
];
}
if
(
!
empty
(
$value
[
0
][
'value'
]))
{
$return
=
$value
[
0
][
'value'
];
}
break
;
case
'attachment'
:
$return
=
[];
...
...
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