POW just deleted 2035 out of my log pheeew..
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | coder.module-317254.patch | 1.61 KB | deekayen |
| #11 | 317254-undefined-indexes-offsets-D6.patch | 1.62 KB | dave reid |
| #10 | coder-fix-undefined-index-php-error.patch | 622 bytes | eMPee584 |
| #9 | coder-fix-theme-processing.patch | 3.37 KB | eMPee584 |
| #8 | coder.index_.patch | 968 bytes | dave reid |
Comments
Comment #1
brmassa commentedGuys,
Using the latest D6, which reports PHP E_ALL warnings, the Coder module, when scanning files, rise dozen warnings like the title:
Undefined offset: -1 in */modules/coder/coder.module on line 1203.consider implement such patch (starting from line 1202 more or less):
regards,
massa
Comment #2
scor commentedI notice the same thing in 2.x (not in 1.x). The strange thing is that it doesn't happen all the time. It seems to only happen the first time you run coder against a module. can't really understand why though...
Comment #3
dave reidYeah I just updated to the 6.x-2.x and this notice is really annoying...
Comment #4
stella commentedI can't reproduce this issue with 6.x-2.x. Can you confirm you ran update.php after upgrading the module?
Comment #5
scor commentedI experienced this when using coder 2.x on a fresh Drupal core. I believe this might have to do with the caching.
Steps to reproduce:
- cvs co -r DRUPAL-6--2 -d coder contributions/modules/coder
- enable coder in admin/build/modules
- click on the 'code review' link of the aggregator module for example: you will see all these warnings appearing
- reload the page and they disappear
The same behavior happens for any module.
Comment #6
stella commentedI can reproduce this consistently when running coder's simpleTests. However I'm not sure that the patch suggested in #1 is the correct solution.
Comment #7
dave reidI can also pretty much reproduce this bug when selecting all the coder tests except for the converting x to x tests, selecting all minor results, and running the check on one module.
Comment #8
dave reidI adjusted the 'reset' values of $this_quote_index and $this_doublequote_index to 0 instead of -1. The default value for the array being used with these indexes is array(''), and after studying the code, it doesn't seem to make sense to use -1. If we want to change the first value of the array, it should be 0. After I patched coder.module, I tested this with making the first quote or double-quote lines in a module with an error that should be caught, and they were correctly caught, so there is no difference in results.
I hope I made that clear? I doubt it. Either way, this patch works for me and I get no change in results, and now no PHP notice errors.
Comment #9
eMPee584 commentedthat patch seems good... i found another problem: coder tries to operate on theme info files, which is stupid and causes alot of errors. Here's the patch, including the former one. *No-more-php-errors-frenzy* !!! ;)
Comment #10
eMPee584 commentedand here is another undefined index error fix..
Comment #11
dave reidCombined patches in #8 and #10. For the sake of the kittens, let's make #9 a separate issue so that this patch can get committed. It'd be nice not to have to scroll through tons of undefined index errors to get to the code results.
Comment #12
deekayen commentedI have similar problems. The attached patch is how I made the notices go away. I used #1's style (modified) to fix the 1203 and 1205 quote notices and #11 to fix the $link notice. I don't know the implications of #11's default index change, and I'm sure about what isset() does, which is why I'm offering up another solution.
Comment #13
stella commentedFixed. None of the patches above corrected the real issue for the negative index - there was a reason the index variables were initialized to -1. However, this is now fixed and will be available in the next dev release later today.
Cheers,
Stella
Comment #14
dave reidThanks you for finally fixing this! :) Being a developer and using E_ALL | E_NOTICE really gets annoying sometimes, so this is one thing off the list!
Comment #15
stella commented@Dave Reid: no problem. Though 6.x-1.x is still the recommended version ;) If you're at Drupalcon, please come to the 'coder' sprint tomorrow where we'll be working on 6x to 7x reviews and other improvements.
Cheers,
Stella
Comment #16
dave reidI'm debating it. I think I sat right behind you at the usability session yesterday with webchick, but I didn't introduce myself. Silly me.