Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download emails in 3.0.2 after upgrade from 2.3.6 #66

Closed
cpinfold opened this issue Aug 5, 2015 · 6 comments
Closed

Download emails in 3.0.2 after upgrade from 2.3.6 #66

cpinfold opened this issue Aug 5, 2015 · 6 comments
Labels
Milestone

Comments

@cpinfold
Copy link
Contributor

cpinfold commented Aug 5, 2015

download_emails.php calls Email_Account::getAccountID (on line 172) and it returns 0 after an upgrade from 2.3.6. DB_Helper::getInstance()->getOne() is returning null within that function. Executing the SQL from getAccountID returns the correct result when executed manually. (See comment 4 for clarification)

download_emails.php was called with only a user and host (not folder) as my accounts are using POP3.

I'll try and trace it further, for now I have hard-coded the account ID's for my accounts. After hard-coding, the balance of the script is working correctly.

Also the UPGRADE doc should be updated to point out the cron scripts moved from the crons folder to the bin folder.

@plindry
Copy link

plindry commented Oct 5, 2015

I have the same problem in line near 169 "$account_id = Email_Account::getAccountID($config['username'], $config['hostname'], $config['mailbox']);" it always return 0. I've hardcoded the id. In the database is 1 for the only one email account configured. (POP3)

My eventum 3.02 is a clean installation.

@glensc
Copy link
Member

glensc commented Oct 5, 2015

care to make patch (as pull-request) with proper fix?

@cpinfold
Copy link
Contributor Author

cpinfold commented Oct 5, 2015

I've found the issue and can write something up, any preference as to the solution:

The issue is caused when using POP accounts, there is no folder. Because $config['mailbox'] is null, however the database contains '' (probably a legacy issue)

Eg.
select * from eventum_email_account where ema_folder is null; Returns nothing.
select * from eventum_email_account where ema_folder = ''; Returns the email account.

Quick fix for affected users: If you go and edit each of the email account settings and save them, the current page stores NULL (this fixes the issue)
Or alternate SQL fix:
UPDATE {your prefix}email_account SET ema_folder = null where ema_folder is '' and ema_type LIKE 'pop%';

Options:

  1. Replace '' with NULL on upgrade as a DB change for POP accounts?
  2. Cause null folder search to also allow '', eg or ema_folder = ''
  3. Change query on null folder to omit ema_folder from search
  4. Do nothing and require users to manually fix

Other ideas?

@glensc
Copy link
Member

glensc commented Oct 5, 2015

i think safest is to change sql query. ping @balsdorf

@balsdorf
Copy link
Contributor

balsdorf commented Oct 5, 2015

I'd go with 3. If $mailbox is null, don't include it in the where clause.

cpinfold added a commit to cpinfold/eventum that referenced this issue Oct 5, 2015
@glensc glensc added this to the 3.0.3 milestone Oct 6, 2015
@glensc glensc added the bug label Oct 6, 2015
@glensc
Copy link
Member

glensc commented Oct 6, 2015

merged. thanks!

i guess it got broken with this commit: 822a32a
a long shot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants