Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
regex_redirect
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
regex_redirect
Merge requests
!9
Remove broken and unnecessary constructor
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Remove broken and unnecessary constructor
fix-constructor-bug
into
1.0.x
Overview
0
Commits
1
Pipelines
2
Changes
1
Merged
Lara
requested to merge
fix-constructor-bug
into
1.0.x
10 months ago
Overview
0
Commits
1
Pipelines
2
Changes
1
Expand
0
0
Merge request reports
Compare
1.0.x
1.0.x (base)
and
latest version
latest version
ac819071
1 commit,
10 months ago
1 file
+
1
−
19
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/Form/RegexRedirectForm.php
+
1
−
19
Options
@@ -3,7 +3,6 @@
namespace
Drupal\regex_redirect\Form
;
use
Drupal\Component\Utility\UrlHelper
;
use
Drupal\Core\Config\ConfigFactoryInterface
;
use
Drupal\Core\Entity\ContentEntityForm
;
use
Drupal\Core\Form\FormStateInterface
;
use
Drupal\Core\Language\Language
;
@@ -19,23 +18,6 @@ use Drupal\regex_redirect\Entity\RegexRedirect;
*/
class
RegexRedirectForm
extends
ContentEntityForm
{
/**
* The config factory.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected
$configFactory
;
/**
* Constructs a RegexRedirectForm object.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The configuration factory.
*/
public
function
__construct
(
ConfigFactoryInterface
$config_factory
)
{
$this
->
configFactory
=
$config_factory
;
}
/**
* {@inheritdoc}
*
@@ -269,7 +251,7 @@ class RegexRedirectForm extends ContentEntityForm {
* The source path.
*/
protected
function
setBlackListErrors
(
FormStateInterface
$form_state
,
$source_path
)
{
$blacklisted_source_paths
=
$this
->
configFactory
->
get
(
'regex_redirect.settings'
)
->
get
(
'blacklisted_source_paths'
);
$blacklisted_source_paths
=
parent
::
config
(
'regex_redirect.settings'
)
->
get
(
'blacklisted_source_paths'
);
foreach
(
$blacklisted_source_paths
as
$path
)
{
if
(
strpos
(
$source_path
,
ltrim
(
$path
,
'/'
))
===
0
)
{
$form_state
->
setErrorByName
(
'redirect_redirect'
,
$this
->
t
(
Loading