Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Community
WSSlots
Commits
e558ac99
Commit
e558ac99
authored
Apr 29, 2022
by
Marijn van Wezel
❤
Browse files
Remove duplicate pre-defined properties
parent
54fbb3af
Pipeline
#2957
passed with stages
in 32 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
extension.json
View file @
e558ac99
{
"name"
:
"WSSlots"
,
"version"
:
"2.
0
.0"
,
"version"
:
"2.
1
.0"
,
"namemsg"
:
"wsslots-extensionname"
,
"url"
:
"https://wikibase-solutions.com"
,
"type"
:
"other"
,
...
...
src/WSSlots.php
View file @
e558ac99
...
...
@@ -6,7 +6,6 @@ use CommentStoreComment;
use
Content
;
use
ContentHandler
;
use
MediaWiki\MediaWikiServices
;
use
MediaWiki\Revision\SlotRoleRegistry
;
use
MediaWiki\Storage\SlotRecord
;
use
MWException
;
use
RequestContext
;
...
...
@@ -224,6 +223,14 @@ abstract class WSSlots {
continue
;
}
// Remove any pre-defined properties that exist in both the main semantic data as well as the slot semantic
// data from the main semantic data to prevent them from merging
foreach
(
$slotSemanticData
->
getProperties
()
as
$property
)
{
if
(
!
$property
->
isUserDefined
()
)
{
$semanticData
->
removeProperty
(
$property
);
}
}
$semanticData
->
importDataFrom
(
$slotSemanticData
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment