Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sector-3465097
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Issue forks
sector-3465097
Commits
a64486e4
Commit
a64486e4
authored
5 months ago
by
Gareth Poole
Browse files
Options
Downloads
Patches
Plain Diff
remove problematic update hook to linkit matcher
parent
4e0803db
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/sector_text_formats/sector_text_formats.install
+1
-40
1 addition, 40 deletions
modules/sector_text_formats/sector_text_formats.install
with
1 addition
and
40 deletions
modules/sector_text_formats/sector_text_formats.install
+
1
−
40
View file @
a64486e4
...
...
@@ -34,43 +34,4 @@ function sector_text_formats_install() {
$editor_role_object
->
save
();
}
}
/**
* Implements hook_update_N().
*/
function
sector_text_formats_update_9001
()
{
// The machine name of the Linkit profile you want to update.
$profile_id
=
'sector_linkit'
;
// Load the Linkit profile configuration.
$config
=
\Drupal
::
configFactory
()
->
getEditable
(
"linkit.linkit_profile.
$profile_id
"
);
if
(
$config
->
isNew
())
{
// If the profile does not exist, inform the user.
\Drupal
::
messenger
()
->
addMessage
(
t
(
'The Linkit profile %profile does not exist.'
,
[
'%profile'
=>
$profile_id
]),
'error'
);
return
;
}
// Get the existing matchers.
$matchers
=
$config
->
get
(
'matchers'
);
// Check if 'external' matcher is already in the profile.
if
(
!
in_array
(
'external'
,
$matchers
))
{
// Add 'external' matcher to the matchers array.
$matchers
[]
=
'external'
;
// Update the configuration with the new matchers array.
$config
->
set
(
'matchers'
,
$matchers
);
// Save the updated configuration.
$config
->
save
();
// Inform the user of the update.
\Drupal
::
messenger
()
->
addMessage
(
t
(
'The external matcher has been added to the Linkit profile %profile.'
,
[
'%profile'
=>
$profile_id
]));
}
else
{
// Inform the user that the matcher already exists.
\Drupal
::
messenger
()
->
addMessage
(
t
(
'The external matcher is already present in the Linkit profile %profile.'
,
[
'%profile'
=>
$profile_id
]),
'status'
);
}
}
\ No newline at end of file
}
\ No newline at end of file
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