Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tmgmt
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
tmgmt
Merge requests
!33
Issue
#3116287
: validateMaxLength gives bogus errors
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Issue
#3116287
: validateMaxLength gives bogus errors
issue/tmgmt-3116287:3116287-validatemaxlength-gives-bogus
into
8.x-1.x
Overview
0
Commits
2
Pipelines
3
Changes
2
Merged
Taras Kyryliuk
requested to merge
issue/tmgmt-3116287:3116287-validatemaxlength-gives-bogus
into
8.x-1.x
2 years ago
Overview
0
Commits
2
Pipelines
3
Changes
2
Expand
0
0
Merge request reports
Compare
8.x-1.x
version 4
11994120
7 months ago
version 3
ff53e1a5
10 months ago
version 2
4cc372bc
10 months ago
version 1
ff0bdb14
2 years ago
8.x-1.x (base)
and
latest version
latest version
11994120
2 commits,
7 months ago
version 4
11994120
2 commits,
7 months ago
version 3
ff53e1a5
2 commits,
10 months ago
version 2
4cc372bc
2 commits,
10 months ago
version 1
ff0bdb14
1 commit,
2 years ago
2 files
+
48
−
5
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
src/Form/JobItemForm.php
+
2
−
2
Options
@@ -311,10 +311,10 @@ class JobItemForm extends TmgmtFormBase {
*/
public
function
validateMaxLength
(
array
$element
,
FormStateInterface
&
$form_state
)
{
if
(
isset
(
$element
[
'#max_length'
])
&&
(
$element
[
'#max_length'
]
<
strlen
(
$element
[
'#value'
])))
{
&&
(
$element
[
'#max_length'
]
<
mb_
strlen
(
$element
[
'#value'
])))
{
$form_state
->
setError
(
$element
,
$this
->
t
(
'The field has @size characters while the limit is @limit.'
,
[
'@size'
=>
strlen
(
$element
[
'#value'
]),
'@size'
=>
mb_
strlen
(
$element
[
'#value'
]),
'@limit'
=>
$element
[
'#max_length'
],
])
);
Loading