Email issue

Hello. Please I need help. I’m not a developper. I just installed the suitecrm 7.10.9 version and after following some steps to solve some problems in displayEmailAdressOptInField.php, I now receive the following message :

Parse error: syntax error, unexpected ‘}’, expecting end of file in C:\xampp\htdocs\suitecrm\modules\Emails\include\displayEmailAddressOptInField.php on line 88

I know nothing about coding. I’m just a user. Could someone help me please ?

The page looks like this :

<?php /** * * SugarCRM Community Edition is a customer relationship management program developed by * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. * * SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd. * Copyright (C) 2011 - 2018 SalesAgility Ltd. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License version 3 as published by the * Free Software Foundation with the addition of the following permission added * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more * details. * * You should have received a copy of the GNU Affero General Public License along with * this program; if not, see http://www.gnu.org/licenses or write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA. * * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road, * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com. * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by * SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not * reasonably feasible for technical reasons, the Appropriate Legal Notices must * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". */ if (!defined('sugarEntry') || !sugarEntry) { die('Not A Valid Entry Point'); } /** * @global array $app_strings * @param \Email $focus * @param string $field * @param mixed $value * @param string $view * @return string */ function displayEmailAddressOptInField(Email $focus, $field, $value, $view) { global $app_strings; $log = LoggerManager::getLogger(); $addressField = 'from_name'; if (empty($focus->id)) { $log = LoggerManager::getLogger(); $log->warn('Email ID is Empty'); return ''; } if ( filter_var($focus->from_name, FILTER_VALIDATE_EMAIL) && !filter_var($focus->from_addr, FILTER_VALIDATE_EMAIL) ) { $log->error('Email address is stored in "from_name" field instead of "from_addr"'); } if (empty($focus->from_name)) { $addressField = 'from_addr'; } $emailAddress = $focus->getEmailAddressFromEmailField($addressField); $tick = ''; // Fixed: #5550 if($emailAddress instanceof SugarEmailAddress) { $tick = $emailAddress->getOptInStatusTickHTML(); } $log->warn('Trying to get an email field of non-Basic object'); } return $tick; }
...after following some steps to solve some problems in displayEmailAdressOptInField.php...

You mean you broke the code yourself :lol:

It would be useful if you could point us to the steps you were following…

I think you have a bracket too much, the ending should look like this:


    // Fixed: #5550
    if($emailAddress instanceof SugarEmailAddress) {
        $tick = $emailAddress->getOptInStatusTickHTML();
        $log->warn('Trying to get an email field of non-Basic object');
    }

    return $tick;
}

Thanks a lot. The error message (Parse error: syntax error, unexpected ‘}’, expecting end of file in C:\xampp\htdocs\suitecrm\modules\Emails\include\displayEmailAddressOptInField.php on line 88) is gone. It has now been replaced by the initial message which is displayed as follows:

EMAILS

Notice: Undefined index: LBL_WARN_NO_IMAP in C:\xampp\htdocs\suitecrm\modules\InboundEmail\InboundEmail.php on line 6128

Warning: Use of undefined constant SORTDATE - assumed ‘SORTDATE’ (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\suitecrm\modules\InboundEmail\InboundEmail.php on line 346

Warning: Use of undefined constant SORTDATE - assumed ‘SORTDATE’ (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\suitecrm\modules\InboundEmail\InboundEmail.php on line 354

Warning: Use of undefined constant SORTDATE - assumed ‘SORTDATE’ (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\suitecrm\modules\InboundEmail\InboundEmail.php on line 391

Fatal error: Uncaught Error: Call to undefined function imap_num_msg() in C:\xampp\htdocs\suitecrm\modules\InboundEmail\InboundEmail.php:393 Stack trace: #0 C:\xampp\htdocs\suitecrm\modules\Emails\include\ListView\ListViewDataEmailsSearchOnIMap.php(121): InboundEmail->checkWithPagination(0, 20, Array, Array, Array) #1 C:\xampp\htdocs\suitecrm\modules\Emails\include\ListView\ListViewDataEmails.php(762): ListViewDataEmailsSearchOnIMap->search(Object(Email), Array, ‘’, NULL, Object(InboundEmail), Array, Object(Folder), Object(User), ‘’, -1, 20, Array, Array, Array) #2 C:\xampp\htdocs\suitecrm\modules\Emails\include\ListView\ListViewSmartyEmails.php(119): ListViewDataEmails->getListViewData(Object(Email), ‘’, 0, -1, Array, Array, ‘id’, true, NULL) #3 C:\xampp\htdocs\suitecrm\include\MVC\View\views\view.list.php(294): ListViewSmartyEmails->setup(Object(Email), ‘include/ListVie…’, ‘’, Array) #4 C:\xampp\htdocs\suitecrm\include\MVC\View\views\view.list.php(402): ViewList->listViewProcess() #5 C:\xampp\htdocs\suitecrm\include\M in C:\xampp\htdocs\suitecrm\modules\InboundEmail\InboundEmail.php on line 393

Please, is there any way out ?

Please try upgrading to 7.10.10 which came out today, I’m not sure this problem has been addressed but I know it includes a few email fixes.