Opened 4 years ago
Closed 4 years ago
#1485862 closed Bugs (wontfix)
env in javascript not always fully set.
| Reported by: | corbosman | Owned by: | |
|---|---|---|---|
| Priority: | 5 | Milestone: | 0.3-stable |
| Component: | Core functionality | Version: | git-master |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Hi all, im working on a plugin (api) that allows our customers to report spam and non-spam to our spamfilters. It's working just fine, and is already in production. There is just one minor snag. It seems as if the full environment isnt always set in javascript. Specifically, at times rcmail.env.junk_mailbox is undefined.
The following snippet shows this, this is a .js included in a plugin .php.
callback for app-onload event
if (window.rcmail) {
rcmail.addEventListener('init', function(evt) {
var a = 1; set breakpoint, check rcmail.env.junk_mailbox
a = a+1; whatever, just something to break on.
});
}
If you go to your junk folder, then double-click on a mail to show the full mail window (not preview), then rcmail.env.junk_mailbox isnt defined. Maybe others as well, but since I need to check on this specifically I noticed. So right now im hardcoding our junk folder, which is luckily unchangeable by our users.
In all other cases it seems all set, except in this case where your action=show am i missing this. Is this intentional?
This is SVN 2516.
Change History (1)
comment:1 Changed 4 years ago by alec
- Component changed from Addressbook to Core functionality
- Resolution set to wontfix
- Status changed from new to closed

Yes, Roundcube don't needs junk_mailbox name there. So, you just should read config and set env in your plugin's .php.