yes it is related to same issue.
but when i configured multiple inbound emails and i have rearranged columns in the detailview template under Admin >> STUDIO section.
Hi @ctucker1984 ,cA
Thanks for the effort you gave. Well, practically I am not into programming and we are trying to deploy suiteCRM. But encountered monitored folder issue.
With you solution, I can get to see inbox and sent. Earlier, sent was also not available. But the issue is still I can not see the selected folder (monitored folder) in the display. If I click its still redirects to main inbox only. Hope, you can help me out.
Thank you @ctucker1984, I can confirm this works for the latest versions of Suite CRM 7.14.1 and 8.4.1 for the Sent and Archive folders, but the Drafts folder is mapped to the Sent folder unless you have a dummy draft email saved on a record for that email account. If you do not have a draft email saved when you visit Drafts, you are taken to a page with no folder selection, and you can get stuck on that page. If you get stuck, log out and back in, and you will return to the INBOX.
How to fix for suitecrm 7.13.4?
function shouldFolderDisplay() not exist, there is nothing over function retrieve().
Compare code:
the following function are missing in 7.13.4:
public function getFirstDisplayFolders(): ?array {
global $current_user;
$settingsFolders = $this->getFoldersForSettings($current_user);
foreach ($settingsFolders['userFolders'] as $folder) {
$isSelected = $folder['selected'] ?? false;
if (isFalse($isSelected)) {
continue;
}
return $folder;
}
foreach ($settingsFolders['groupFolders'] as $folder) {
$isSelected = $folder['selected'] ?? false;
if (isFalse($isSelected)) {
continue;
}
return $folder;
}
return null;
}
/**
* Check if it subscribed
* @param string|null $folderId
* @param array|null $folders
* @return bool
*/
public function isToDisplay(?string $folderId, array $folders = null): bool {
global $current_user;
if (empty($folderId)){
return false;
}
if ($folders === null){
$folders = $this->getFoldersForSettings($current_user);
}
if ($this->shouldFolderDisplay($folders['userFolders'] ?? [], $folderId)) {
return true;
}
if ($this->shouldFolderDisplay($folders['groupFolders'] ?? [], $folderId)) {
return true;
}
return false;
}
/**
* @param array $folders
* @param string $folderId
* @return bool
*/
protected function shouldFolderDisplay(array $folders, string $folderId): bool
{
if (empty($folders)) {
return false;
}
foreach ($folders as $folder) {
$isSelected = $folder['selected'] ?? false;
if (isFalse($isSelected)) {
continue;
}
$id = $folder['id'] ?? '';
if ($id === $folderId) {
return true;
}
}
return false;
}
/**
* @param User|null $user
* @return array
*/
protected function getUserAccessibleInboundIds(?User $user): array
{
$userAccessibleInboundAccountIds = [];
/** @var InboundEmail $inboundEmail */
$inboundEmail = BeanFactory::newBean('InboundEmail');
$accessibleInboundEmails = $inboundEmail->getUserInboundAccounts();
if (!empty($accessibleInboundEmails)) {
foreach ($accessibleInboundEmails as $accessibleInboundEmail) {
if (empty($accessibleInboundEmail)) {
continue;
}
$id = $accessibleInboundEmail->id ?? '';
if (!empty($id)) {
$userAccessibleInboundAccountIds[$id] = true;
}
}
}
return $userAccessibleInboundAccountIds;
}
Can you add it your file and check
I did this and changed the function as in the solution but it still doesn’t work
Do Quick repair and rebuild and check permission and ownership of files.
This one works in 8.7.1 however when clicking on Drafts it gives a blank email page screen. To get out you have to click the back button in the browser.