Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
markdown
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
markdown
Merge requests
!47
Resolve
#3463119
"Abort validation"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Resolve
#3463119
"Abort validation"
issue/markdown-3463119:3463119-abort-validation
into
3.0.x
Overview
0
Commits
4
Pipelines
1
Changes
4
Open
Youri van Koppen
requested to merge
issue/markdown-3463119:3463119-abort-validation
into
3.0.x
2 months ago
Overview
0
Commits
4
Pipelines
1
Changes
4
Expand
Closes
#3463119
0
0
Merge request reports
Compare
3.0.x
3.0.x (HEAD)
and
latest version
latest version
2724dce2
4 commits,
2 months ago
4 files
+
79
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
src/Plugin/Filter/FilterMarkdown.php
+
24
−
0
Options
@@ -419,9 +419,33 @@ class FilterMarkdown extends FilterBase implements ContainerFactoryPluginInterfa
$parserElement
[
'id'
][
'#description'
]
=
$this
->
moreInfo
(
$parserElement
[
'id'
][
'#description'
],
$url
);
}
// When the markdown filter is not enabled, not all required information for
// to validate the settings is available. In this case, clear the settings
// as they are not needed anyway when the markdown filter is disabled.
$element
[
'#element_validate'
][]
=
[
$this
,
'subformValidate'
];
return
$element
;
}
/**
* Removes the markdown settings when the markdown filter is disabled.
*
* @param array $element
* The element being validated.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current form state.
*/
public
function
subformValidate
(
array
$element
,
FormStateInterface
$form_state
)
{
$markdown
=
&
$form_state
->
getValue
([
'filters'
,
'markdown'
]);
// Check if markdown is enabled. If it is not, do not attempt to save any
// settings to avoid validation issues.
if
(
empty
(
$markdown
[
'status'
]))
{
// Do not save any settings.
unset
(
$markdown
[
'settings'
]);
}
}
/**
* The AJAX callback used to return the parser ajax wrapper.
*/
Loading