The mailbox add/edit form has some PHP notices about undefined indexes and undefined variables. The attached patch fixes the issue.
Part of the problem is missing default values for the mailbox form. I took a shortcut and used schema API to grab some defaults, but alternatively some explicit defaults could be defined.
Btw another thing I was looking at but didn't patch is the submit function for this form could probably use drupal_write_record().
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | mailhandler_admin_notices.patch | 2.59 KB | ilo |
| #9 | mailhandler-fixes.patch | 6.78 KB | eMPee584 |
| #3 | mailhandler-admin.patch | 2.14 KB | mfb |
| mailhandler-admin.patch | 2.21 KB | mfb |
Comments
Comment #1
z.stolar commentedThe patch failed for me. Please re-roll.
Also, you might want to check out the 'cron' and 'security' radio buttons, which are stored as text, and so they are initialized to an empty string, while there should be something there.
Why did you choose to initialize the values through the DB, instead of setting them as part of the form?
Comment #2
mfbI just didn't know what the defaults should be (aside from what the schema defines). I can reroll it if/when I have more time to look at correct form defaults..
Comment #3
mfbHere's a reroll with explicit defaults.
Comment #4
z.stolar commentedI'll try to put the same values as part of
$form[...]['#default_value']and will check it.Comment #5
z.stolar commentedHi Mark,
I tried to recreate the notices, but I don't see anything.
I'm using PHP Version 5.2.4-2ubuntu5.3 with apache2, and PHP 'error_reporting = E_ALL'
Comment #6
mfbYou may need to be using the dev version of Drupal to see the notices? See http://cvs.drupal.org/viewvc.py/drupal/drupal/includes/common.inc?r1=1.7...
Comment #7
z.stolar commentedI tried again, I changed common.inc as necessary, but still no errors.
hmmm... I must be missing something, but I don't see what it is.
Comment #8
mfbDo you have Drupal set to display errors on the page? If not they might just be getting logged.
Comment #9
eMPee584 commentedz put this into you index.php at the top:
And you'll see loads of errors. Here are some more fixes, the patch includes the previous ones.
Comment #10
z.stolar commentedeMPee584, you can't RTBC your own patch :-)... but I appreciate the effort!
It took me a while to get to this round of bug fixing, but I'm here at last.
Meanwhile I applied Mark's patch at #3, with few corrections. I would like to better inspect your proposed changes, eMPee584.
Comment #11
ilo commentedI tried to submit a patch, but I'm unable to do so untill #1038910: Wrong endline marker in mailhandler.admin.inc file. is fixed for me. In the meantime, the testcase at #1038922: Verify basic mailbox operations in simpletest testcase. will still show the errors in the administrator pages, however the test does not insert nodes or comments yet, and some of them are still hidden.
Comment #12
ilo commentedsorry, didn't noticed the issue status.
Comment #13
ilo commentedThe test will fail because of #1038928: Default encoding not being shown in system settings form.. There is a patch for this errors in the queue. This patch fixes the admin interface notices (exceptions in the test execution). There are still for fixes but they require much more rewrite than this. So the expected result here is 0 notices and 2 errors.
Comment #15
ilo commentedCommitted, required to make tests pass for the D7 upgrade.
Comment #16
cor3huis commentedWas a little more difficult to review implications from top of my head but i've read, patch and looks fine to me.