Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
52a61ae3
Commit
52a61ae3
authored
Mar 30, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(mvc) small fixes for
https://github.com/opnsense/core/pull/869
parent
78ca1710
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
ModelRelationField.php
...pp/models/OPNsense/Base/FieldTypes/ModelRelationField.php
+12
-4
No files found.
src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/ModelRelationField.php
View file @
52a61ae3
...
...
@@ -117,7 +117,7 @@ class ModelRelationField extends BaseField
* select if multiple data nodes may be selected at once
* @param $value boolean value Y/N
*/
public
function
set
m
ultiple
(
$value
)
public
function
set
M
ultiple
(
$value
)
{
if
(
trim
(
strtoupper
(
$value
))
==
"Y"
)
{
$this
->
internalMultiSelect
=
true
;
...
...
@@ -162,9 +162,17 @@ class ModelRelationField extends BaseField
{
$validators
=
parent
::
getValidators
();
if
(
$this
->
internalValue
!=
null
)
{
// field may contain more than one entries
$validators
[]
=
new
CsvListValidator
(
array
(
'message'
=>
$this
->
internalValidationMessage
,
'domain'
=>
array_keys
(
self
::
$internalOptionList
[
$this
->
internalCacheKey
])));
if
(
$this
->
internalMultiSelect
)
{
// field may contain more than one entries
$validators
[]
=
new
CsvListValidator
(
array
(
'message'
=>
$this
->
internalValidationMessage
,
'domain'
=>
array_keys
(
self
::
$internalOptionList
[
$this
->
internalCacheKey
])
));
}
else
{
// single value selection
$validators
[]
=
new
InclusionIn
(
array
(
'message'
=>
$this
->
internalValidationMessage
,
'domain'
=>
array_keys
(
self
::
$internalOptionList
[
$this
->
internalCacheKey
])));
}
}
return
$validators
;
}
...
...
Write
Preview
Markdown
is supported
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