Moodle

Database activity import: does not bother to check if field names are valid - error message is not helpful

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9.4
  • Fix Version/s: 1.9.5, 2.0
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE, MOODLE_20_STABLE

Description

The import facility requires that the header names match exactly the database field names. If they don't it just breaks. No attempt is made to check their validity. Rough!!

Activity

Hide
Howard Miller added a comment -

Added check that the fields supplied in the CSV file match the ones in the database.

Show
Howard Miller added a comment - Added check that the fields supplied in the CSV file match the ones in the database.
Hide
Jerome Mouneyrac added a comment -

Hi Howard,
I'm not sure what to retest here. In database module the only import operation I see it's in Preset tab. Do I need to export a preset, modify it and import it again? (I tried it and I got a not clear "-2/ Not a preset" error message).

Do you know where we can import the file generated from export tab?

I'll probably write a usability issue for 2.0. And I'll also link the "Export tab" Moodledocs bottom link to http://docs.moodle.org/en/Database_export if no objection.
Thanks

Show
Jerome Mouneyrac added a comment - Hi Howard, I'm not sure what to retest here. In database module the only import operation I see it's in Preset tab. Do I need to export a preset, modify it and import it again? (I tried it and I got a not clear "-2/ Not a preset" error message). Do you know where we can import the file generated from export tab? I'll probably write a usability issue for 2.0. And I'll also link the "Export tab" Moodledocs bottom link to http://docs.moodle.org/en/Database_export if no objection. Thanks
Hide
Howard Miller added a comment -

You simply need to have column headings that don't exactly match field names in the database. Now you should get a sensible error message (it used to just fail).

Show
Howard Miller added a comment - You simply need to have column headings that don't exactly match field names in the database. Now you should get a sensible error message (it used to just fail).
Hide
Jerome Mouneyrac added a comment - - edited

In fact my question was about how to import a database. I didn't find it. I can see two different export functionality, and one "Preset" import functionality. I guess that this one you're talking about?

Show
Jerome Mouneyrac added a comment - - edited In fact my question was about how to import a database. I didn't find it. I can see two different export functionality, and one "Preset" import functionality. I guess that this one you're talking about?
Hide
Howard Miller added a comment -

Yes - it's really stupid - it's a link at the bottom of the "add entry" tab. Who would have thought

Show
Howard Miller added a comment - Yes - it's really stupid - it's a link at the bottom of the "add entry" tab. Who would have thought
Hide
Jerome Mouneyrac added a comment -

Thanks Howard. We spent few minutes with Tim to find this function and we couldn't find it. I'll write an usability issue for that
Otherwise I'll test your fix today

Show
Jerome Mouneyrac added a comment - Thanks Howard. We spent few minutes with Tim to find this function and we couldn't find it. I'll write an usability issue for that Otherwise I'll test your fix today
Hide
Jerome Mouneyrac added a comment -

The error message is now helpful, thanks Howard

Show
Jerome Mouneyrac added a comment - The error message is now helpful, thanks Howard
Hide
Jerome Mouneyrac added a comment -

Just for information I created:
MDL-18591
MDL-18590

Show
Jerome Mouneyrac added a comment - Just for information I created: MDL-18591 MDL-18590

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: