Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vtigercrm
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Welcome to Vtiger Community. To gain access for account, please contact [ community @ vtiger.com ]
Show more breadcrumbs
Christian Cruz Garrido
vtigercrm
Commits
7f21f64a
Commit
7f21f64a
authored
2 years ago
by
Prasad
Browse files
Options
Downloads
Patches
Plain Diff
Fixed: Field::getInstance without module information
parent
d6ce870b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/Settings/LayoutEditor/actions/Field.php
+5
-2
5 additions, 2 deletions
modules/Settings/LayoutEditor/actions/Field.php
vtlib/Vtiger/Field.php
+12
-2
12 additions, 2 deletions
vtlib/Vtiger/Field.php
with
17 additions
and
4 deletions
modules/Settings/LayoutEditor/actions/Field.php
+
5
−
2
View file @
7f21f64a
...
...
@@ -58,7 +58,10 @@ class Settings_LayoutEditor_Field_Action extends Settings_Vtiger_Index_Action {
public
function
save
(
Vtiger_Request
$request
)
{
$currentUser
=
Users_Record_Model
::
getCurrentUserModel
();
$fieldId
=
$request
->
get
(
'fieldid'
);
$fieldInstance
=
Settings_LayoutEditor_Field_Model
::
getInstance
(
$fieldId
);
$sourceModule
=
$request
->
get
(
'sourceModule'
);
$moduleInstance
=
Vtiger_Module_Model
::
getInstance
(
$sourceModule
);
$fieldInstance
=
Settings_LayoutEditor_Field_Model
::
getInstance
(
$fieldId
,
$moduleInstance
);
$fieldLabel
=
$fieldInstance
->
get
(
'label'
);
$mandatory
=
$request
->
get
(
'mandatory'
,
null
);
...
...
@@ -212,4 +215,4 @@ class Settings_LayoutEditor_Field_Action extends Settings_Vtiger_Index_Action {
public
function
validateRequest
(
Vtiger_Request
$request
)
{
$request
->
validateWriteAccess
();
}
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
vtlib/Vtiger/Field.php
+
12
−
2
View file @
7f21f64a
...
...
@@ -214,7 +214,17 @@ class Vtiger_Field extends Vtiger_FieldBasic {
static
function
getInstance
(
$value
,
$moduleInstance
=
false
)
{
global
$adb
;
$instance
=
false
;
if
(
!
$moduleInstance
)
return
$instance
;
if
(
!
$moduleInstance
)
{
// Derive moduleInstance based on FieldId.
if
(
is_numeric
(
$value
))
{
$fieldInfo
=
Vtiger_Functions
::
getModuleFieldInfoWithId
(
$value
);
if
(
$fieldInfo
)
{
$moduleInstance
=
Vtiger_Module_Model
::
getInstance
(
$fieldInfo
[
"tabid"
]);
}
}
}
if
(
!
$moduleInstance
)
return
null
;
$data
=
Vtiger_Functions
::
getModuleFieldInfo
(
$moduleInstance
->
id
,
$value
);
if
(
$data
)
{
$instance
=
new
self
();
...
...
@@ -286,4 +296,4 @@ class Vtiger_Field extends Vtiger_FieldBasic {
self
::
log
(
"Deleting fields of the module ... DONE"
);
}
}
?>
\ 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