Issue Details (XML | Word | Printable)

Key: MDL-14466
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: David Mudrak
Reporter: David Mudrak
Votes: 0
Watchers: 3
Operations

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

Preset importer throws error

Created: 22/Apr/08 04:53 AM   Updated: 04/Jul/08 03:51 AM
Component/s: Database activity module
Affects Version/s: 1.8.5
Fix Version/s: 1.9.1

File Attachments: 1. Text File MDL-14466.patch.txt (0.6 kB)

Environment: Current MOODLE_18_STABLE

Participants: David Mudrak, Dongsheng Cai, Elvedin Trnjanin and Petr Skoda (frankenstein)
Security Level: None
QA Assignee: Dongsheng Cai
Resolved date: 07/May/08
Affected Branches: MOODLE_18_STABLE
Fixed Branches: MOODLE_19_STABLE


 Description  « Hide
What I wanted to do
============
Import Image gallery preset

What happened
=========
Fatal error: Cannot use string offset as an array in /home/mudrd8mz/public_html/moodle-18-stable/mod/data/lib.php on line 1681



 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Petr Skoda (frankenstein) added a comment - 07/May/08 01:16 AM
hello, could you please try to replicate it in latest 1.9+?
and fix if needed

thanks


David Mudrak added a comment - 07/May/08 03:19 AM
The following code inside the foreach statement fixed the bug in MOODLE_19_STABLE and HEAD:

if (!is_array($value)) { continue; }
Latest 1.9.x is OK then.

It was not backported to 1.8 yet. The patch for MOODLE_18_STABLE is attached in MDL-14466.patch.txt

waiting for +2 approval


David Mudrak added a comment - 07/May/08 03:23 AM
fixed in MOODLE_19_STABLE and HEAD recently. Not backported yet.

Petr Skoda (frankenstein) added a comment - 07/May/08 04:06 AM
there are many other bugs in 1.8.x data mod, my +1 to concentrate on 1.9.1

Dongsheng Cai added a comment - 14/May/08 04:10 PM
Thanks

Elvedin Trnjanin added a comment - 04/Jul/08 03:49 AM
This issue also happens in line 1693, so it should say

foreach ($field'#' as $param => $value) {
if (!is_array($value)) { continue; }
$f->$param = $value[0]'#';
}


Elvedin Trnjanin added a comment - 04/Jul/08 03:51 AM
...for 1.8.5