[Vtigercrm-developers] Use of vtiger_def_org_field?
Alan Lord
alanslists at gmail.com
Fri Mar 10 14:55:20 GMT 2023
Searching the email archive I found this thread from July 2020 started
by Ruben:
http://lists.vtigercrm.com/pipermail/vtigercrm-developers/2020-July/038804.html
And this ticket:
https://code.vtiger.com/vtiger/vtigercrm/-/issues/1446
That I also commented on.
So I think we still have no idea what this table is actually for ;-)
Al
On 10/03/2023 11:02, Alan Lord wrote:
> I had an odd thing happen recently...
>
> This is on a vtiger 7.4.0 system which had been migrated from a vtiger
> 5.x system. At some point in the past, probably when it was v5, the
> customer had hidden the secondary email field in the Accounts module
> (fieldname = email2) - using the layout editor.
>
> On Wednesday we needed to use that field again so using the layout
> editor I re-activiated the field. As an admin, all was fine but
> non-admin users couldn't see the field. Checking the Profiles, the field
> was hidden (black) in the non-admin profiles so I made it green
> (read/write) and saved the profile. The field still wasn't visible...
>
> Looking in the database the definition of the two fields
> (vtiger_field.fieldid 9 & 11) they were pretty much the same
> configuration (i.e. all the important values like "presence" etc.). And
> in vtiger_profile2field they were both configured the same too (for all
> Profiles)!
>
> I scratched my head...
>
> This morning I decided to take a better look around the database and
> discovered the visible value was different between fieldid 9 & 11 in the
> vtiger_def_org_field table. Changing the value fixed the problem and the
> field was now visible.
>
> This isn't something I've seen before - in well over a decade - and to
> be honest I've never really needed to delve into the
> vtiger_def_org_field table. So I was just wondering if someone can tell
> me what it is really for?
>
> Grepping the code I can see values are retrieved in CRMEntity, and in a
> few other places, but it isn't really clear what it is for and why it
> wasn't updated correctly when I changed the visibility of a field using
> the normal Admin UI tools.
>
> There are not many places where it is written to...
>
> In the Profiles Record Model:
>
> https://code.vtiger.com/vtiger/vtigercrm/-/blob/master/modules/Settings/Profiles/models/Record.php#L873
>
> This method looks a bit wrong to me. It's only got an INSERT statement.
> Shouldn't this really be an "INSERT ... ON DUPLICATE KEY UPDATE "
> instead? Or else it will never get updated surely?
>
> Same here:
> https://code.vtiger.com/vtiger/vtigercrm/-/blob/master/include/utils/utils.php#L679
>
> There is no way to update. A row in this table would need to be deleted
> and then re-created.
>
>
> TIA
>
> Al
>
> _______________________________________________
> http://www.vtiger.com/
>
More information about the vtigercrm-developers
mailing list