Issue Details (XML | Word | Printable)

Key: MDL-20966
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Trivial Trivial
Assignee: Andrew Davis
Reporter: Anthony Borrow
Votes: 0
Watchers: 1
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

PHP Notice: Undefined offset: 1 in /home/arborrow/Moodle/code/19stable/lib/componentlib.class.php on line 480

Created: 25/Nov/09 09:44 AM   Updated: 03/Dec/09 09:02 AM
Component/s: Lib
Affects Version/s: 1.9.6
Fix Version/s: 1.9.8

File Attachments: 1. Text File componentlib.class.php.patch (0.8 kB)

Image Attachments:

1. componentlib.png
(140 kB)

Participants: Andrew Davis, Anthony Borrow and Petr Škoda (skodak)
Security Level: None
Resolved date: 03/Dec/09
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_19_STABLE


 Description  « Hide
During a recent upgrade on my test server on 19stable I came across a PHP Notice: Undefined offset: 1 in /home/arborrow/Moodle/code/19stable/lib/componentlib.class.php on line 480. Looks like we might want to check for empty like we do for 2. Peace - Anthony

p.s. I tagged this as fix for 1.9.8 and trivial since the notice does not cause any failure other than drawing attention to itself when debugging is on.



 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Andrew Davis added a comment - 02/Dec/09 02:15 PM
Patch attached. I pulled this section of code out and ran it in a test page and it stubbornly refused to produce the error. Not sure why. Regardless, here is a patch that adds a guard around that line. I'll commit it after its been reviewed.

Anthony Borrow added a comment - 02/Dec/09 02:33 PM
Andy - I'm not sure what may have caused it, it was on my test server so who knows. I would have to look and see how the component array was being set up but the patch looks good. I would want to better understand what the various components are to see why certain ones may be empty and under what conditions but that will have to wait for another day as I am going to bed. Peace - Anthony

Petr Škoda (skodak) added a comment - 02/Dec/09 05:09 PM
+1 for commit

Andrew Davis added a comment - 03/Dec/09 09:02 AM
committed