Problem with the link-file

Hello everyone,

Since version 12 was updated, the following warning is shown in the log.
"Usage of "link_file" in vardefs has been deprecated. This code will stop working from the next release."

I would like to know if there is a possible solution or any comment on how I could modify the code so that the log message stops appearing.
The code that would have to change would be this:

$dictionary['Lead']['fields']['archived_emails']['link_file'] = 'custom/modules/Emails/CustomArchivedEmailsLink.php';
$dictionary['Lead']['fields']['archived_emails']['link_class'] = 'CustomArchivedEmailsLink';

Located at : custom\Extension\modules\Leads\Ext\Vardefs\emailsLink.php

A recommendation on this would help us a lot since I was reviewing it to change it and I still haven't found a solution.

Within the php CustomArchivedEmailsLink a native CRM function is modified (ArchivedEmailsLink.php is the file).

Best regards.

Parents
  • Hello!

    Contained in this Health Check article is the following explanation...

    The vardef attribute "link_file" has been deprecated. From now on, you will have to use the "link_class" attribute. The class specified for "link_class" should be autoloadable by composer or SugarAutoLoader.

    To use SugarAutoLoader, for your example, we would copy the file containing the class definition...

    custom/modules/Emails/CustomArchivedEmailsLink.php

    ...to one of the paths defined as Class Loading Directories in the dev guide.

    We might create a new directory as custom/include/CustomArchivedEmailsLink and copy the file to it. At this point we would run a QRR so that SugarAutoLoader will rebuild the cache/class_map.php file.

    Looking at cache/class_map.php, we can confirm we are seeing...

    'CustomArchivedEmailsLink' => 'custom/include/CustomArchivedEmailsLink/CustomArchivedEmailsLink.php',

    Once that is done we can comment out or delete the line...

    $dictionary['Lead']['fields']['archived_emails']['link_file'] = 'custom/modules/Emails/CustomArchivedEmailsLink.php';

    ...and remove the file custom/modules/Emails/CustomArchivedEmailsLink.php.

    I hope this is helpful.

Reply
  • Hello!

    Contained in this Health Check article is the following explanation...

    The vardef attribute "link_file" has been deprecated. From now on, you will have to use the "link_class" attribute. The class specified for "link_class" should be autoloadable by composer or SugarAutoLoader.

    To use SugarAutoLoader, for your example, we would copy the file containing the class definition...

    custom/modules/Emails/CustomArchivedEmailsLink.php

    ...to one of the paths defined as Class Loading Directories in the dev guide.

    We might create a new directory as custom/include/CustomArchivedEmailsLink and copy the file to it. At this point we would run a QRR so that SugarAutoLoader will rebuild the cache/class_map.php file.

    Looking at cache/class_map.php, we can confirm we are seeing...

    'CustomArchivedEmailsLink' => 'custom/include/CustomArchivedEmailsLink/CustomArchivedEmailsLink.php',

    Once that is done we can comment out or delete the line...

    $dictionary['Lead']['fields']['archived_emails']['link_file'] = 'custom/modules/Emails/CustomArchivedEmailsLink.php';

    ...and remove the file custom/modules/Emails/CustomArchivedEmailsLink.php.

    I hope this is helpful.

Children
No Data